rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file)
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in fu...
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
self.WriteGLES2ImplementationDeclaration(func, file)
file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in fu...
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
if func.GetInfo('result') == None: func.AddInfo('result', ['uint32'])
def InitFunction(self, func): """Overrriden from TypeHandler.""" func.AddCmdArg(Argument("result_shm_id", 'uint32')) func.AddCmdArg(Argument("result_shm_offset", 'uint32')) if func.GetInfo('result') == None: func.AddInfo('result', ['uint32'])
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Wri...
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" Wa...
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" ...
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def InitFunction(self, func): """Overrriden from TypeHandler.""" cmd_args = func.GetCmdArgs() func.ClearCmdArgs() func.AddCmdArg(cmd_args[0]) func.AddCmdArg(Argument('bucket_id', 'uint32'))
def InitFunction(self, func): """Overrriden from TypeHandler.""" # remove all but the first cmd args. cmd_args = func.GetCmdArgs() func.ClearCmdArgs() func.AddCmdArg(cmd_args[0]) # add on a bucket id. func.AddCmdArg(Argument('bucket_id', 'uint32'))
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
code = """%(return_type)s %(func_name)s(%(args)s) { helper_->SetBucketSize(kResultBucketId, 0); helper_->%(func_name)s(%(id_name)s, kResultBucketId); std::string str; if (GetBucketAsString(kResultBucketId, &str)) { GLsizei max_size = std::min(static_cast<size_t>(%(bufsize_name)s) - 1, str.size()); if (%(length_name)s !...
file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file)
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { const char* kInfo = "hello"; const uint32 kBucketId = 123; SpecializedSetup<%(name)s, 0>(); %(expect_len_code)s EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)) .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)), SetArrayArgument<3>(kInfo, kInfo + strlen(kIn...
file.Write("// TODO(gman): %s\n\n" % func.name) def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name)
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* ...
args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_last_2_args: arg.WriteGetCode(file) self.WriteGetDataSizeCode(func, file) size_arg = args[-2] file.Write(" uint32 size_shm_id = c.%s_shm_id;\n" % size_arg.name) file.Write(" uint32 size_shm_offset = c.%s_shm_offset;\n" % size_arg.name) f...
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode...
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
" %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name))
" %s %s = GetSharedMemoryAs<%s>(\n" % (dest_arg.type, dest_arg.name, dest_arg.type)) file.Write( " c.%s_shm_id, c.%s_shm_offset, %s);\n" % (dest_arg.name, dest_arg.name, bufsize_arg.name)) for arg in all_but_last_2_args + [dest_arg]: arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerIm...
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode...
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 0
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
pass def WriteClientSideValidationCode(self, file): """Writes the validation code for an argument.""" pass
if self.type == 'GLsizei' or self.type == 'GLsizeiptr': file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
"""class for GLsizei and GLsizeiptr."""
def GetImmediateVersion(self): """Gets the immediate version of this argument.""" return self
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
if func.is_immediate: return 0
def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
"""overridden from Argument."""
"""returns an invalid value and expected parse result by index."""
def GetInvalidArg(self, offset, index): """overridden from Argument.""" return ("-1", "kNoError", "GL_INVALID_VALUE")
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" ...
def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
"""Base class for EnumArgument, IntArgument and BoolArgument"""
"""Base calss for EnumArgument, IntArgument and BoolArgument"""
def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n")
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] return len(invalid) return 0
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_error)
return (invalid[index], "kNoError", "GL_INVALID_ENUM") return ("---ERROR1---", "kNoError", "GL_INVALID_ENUM")
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_...
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func): """Overridden from Argument.""" return 2
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
self.is_immediate = False
def __init__(self, original_name, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = original_name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_a...
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def AddInfo(self, name, value): """Adds an info.""" setattr(self.info, name, value)
def GetInfo(self, name): """Returns a value from the function info for this function.""" if hasattr(self.info, name): return getattr(self.info, name) return None
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
def ClearCmdArgs(self): """Clears the command args for this function.""" self.cmd_args = []
def GetCmdArgs(self): """Gets the command args for this function.""" return self.cmd_args
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
self.is_immediate = True
def __init__(self, func): new_args = [] for arg in func.GetOriginalArgs(): new_arg = arg.GetImmediateVersion() if new_arg: new_args.append(new_arg)
56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py
'<a href="/echo">back to referring page</a></div>'
'<a href="http://localhost:8888/echo">back to referring page</a></div>'
def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents."""
d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py
print 'HTTPS server started on port %d...' % server.server_port
print 'HTTPS server started on port %d...' % port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py
print 'HTTP server started on port %d...' % server.server_port
print 'HTTP server started on port %d...' % port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py
listen_port = server.server_port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py
listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port
print 'FTP server started on port %d...' % port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py
startup_pipe.write(struct.pack('@H', listen_port))
startup_pipe.write("READY")
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py
option_parser.add_option('', '--port', default='0', type='int', help='Port used by the server. If unspecified, the ' 'server will listen on an ephemeral port.')
option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.')
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py
file_path = os.path.join(output_dir, ARCHIVE_DIR)
prefixed_archive_dir = (options.archive_prefix or "") + ARCHIVE_DIR file_path = os.path.join(output_dir, prefixed_archive_dir)
def MakeStagingDirectories(output_dir): """Creates a staging path for installer archive. If directory exists already, deletes the existing directory. """ file_path = os.path.join(output_dir, ARCHIVE_DIR) if os.path.exists(file_path): shutil.rmtree(file_path) os.makedirs(file_path) temp_file_path = os.path.join(output_...
0aec17d368206b95f01b7f7b76dee6a981718add /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0aec17d368206b95f01b7f7b76dee6a981718add/create_installer_archive.py
temp_file_path = os.path.join(output_dir, TEMP_ARCHIVE_DIR)
prefixed_temp_archive_dir = (options.archive_prefix or "") + TEMP_ARCHIVE_DIR temp_file_path = os.path.join(output_dir, prefixed_temp_archive_dir)
def MakeStagingDirectories(output_dir): """Creates a staging path for installer archive. If directory exists already, deletes the existing directory. """ file_path = os.path.join(output_dir, ARCHIVE_DIR) if os.path.exists(file_path): shutil.rmtree(file_path) os.makedirs(file_path) temp_file_path = os.path.join(output_...
0aec17d368206b95f01b7f7b76dee6a981718add /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0aec17d368206b95f01b7f7b76dee6a981718add/create_installer_archive.py
self.files_to_remove = []
self._files_to_remove = []
def setUp(self): pyauto.PyUITest.setUp(self) # Record all entries in the download dir download_dir = self.GetDownloadDirectory().value() self._existing_downloads = [] if os.path.isdir(download_dir): self._existing_downloads += os.listdir(download_dir) self.files_to_remove = [] # Files to remove after browser shutdown
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
self.files_to_remove.append(os.path.join(download_dir, name))
self._files_to_remove.append(os.path.join(download_dir, name))
def tearDown(self): # Cleanup all files we created in the download dir download_dir = self.GetDownloadDirectory().value() if os.path.isdir(download_dir): for name in os.listdir(download_dir): if name not in self._existing_downloads: self.files_to_remove.append(os.path.join(download_dir, name)) pyauto.PyUITest.tearDown(...
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
for item in self.files_to_remove:
for item in self._files_to_remove:
def tearDown(self): # Cleanup all files we created in the download dir download_dir = self.GetDownloadDirectory().value() if os.path.isdir(download_dir): for name in os.listdir(download_dir): if name not in self._existing_downloads: self.files_to_remove.append(os.path.join(download_dir, name)) pyauto.PyUITest.tearDown(...
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._DeleteAfterShutdown(downloaded_pkg)
def testSaveDangerousFile(self): """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove...
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._DeleteAfterShutdown(downloaded_pkg)
def testRemoveDownload(self): """Verify that we can remove a download.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_path = os.path.join(test_dir, 'a_zip_file.zip') file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'a_zip_file...
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
try: file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self._CallFunctionWithNewTimeout(4 * 60 * 1000, self.WaitForAllDownloads...
self._DeleteAfterShutdown(file_path) file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self._DeleteAfterShutdown(downloaded_pkg) ...
def testBigZip(self): """Verify that we can download a 1GB file.
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
os.path.exists(filename) and os.remove(filename)
self._DeleteAfterShutdown(filename)
def testFileRenaming(self): """Test file renaming when downloading a already-existing filename.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_url = 'file://%s' % os.path.join(test_dir, 'a_zip_file.zip') download_dir = self.GetDownloadDirectory().value()
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
try: for filename in crazy_filenames: utf8_filename = filename.encode('utf-8') file_path = os.path.join(temp_dir, utf8_filename) _CreateFile(os.path.join(temp_dir, filename)) file_url = self.GetFileURLForPath(file_path) downloaded_file = os.path.join(download_dir, filename) os.path.exists(downloaded_file) and os.remove...
for filename in crazy_filenames: utf8_filename = filename.encode('utf-8') file_path = os.path.join(temp_dir, utf8_filename) _CreateFile(os.path.join(temp_dir, filename)) file_url = self.GetFileURLForPath(file_path) downloaded_file = os.path.join(download_dir, filename) os.path.exists(downloaded_file) and os.remove(down...
def _CreateFile(name): """Create and fill the given file with some junk.""" fp = open(name, 'w') # name could be unicode print >>fp, 'This is a junk file named %s. ' % repr(name) * 100 fp.close()
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
try: file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) pause_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle...
file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self._DeleteAfterShutdown(downloaded_pkg) self._DeleteAfterShutdown(file_path...
def testPauseAndResume(self): """Verify that pause and resume work while downloading a file.
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
self.files_to_remove.append(file_path)
self._DeleteAfterShutdown(file_path)
def testCancelDownload(self): """Verify that we can cancel a download.""" # Create a big file (250 MB) on the fly, so that the download won't finish # before being cancelled. file_path = self._MakeFile(2**28) file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(),...
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._DeleteAfterShutdown(downloaded_pkg)
def testDownloadsPersistence(self): """Verify that download history persists on session restart.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_url = self.GetFileURLForPath(os.path.join(test_dir, 'a_zip_file.zip')) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'a_zip_...
9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py
server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json)
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
e98ed6c2044d751b05eace99e5a3cf191ecda36b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e98ed6c2044d751b05eace99e5a3cf191ecda36b/testserver.py
ret += ["--show-possible=no"]
ret += ["--show-possibly-lost=no"]
def ToolSpecificFlags(self): ret = ["--leak-check=full", "--gen-suppressions=all", "--demangle=no"]
da2c1ee6a181402c83f3a9783e8c3a28bf613ab9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/da2c1ee6a181402c83f3a9783e8c3a28bf613ab9/valgrind_test.py
url='http://localhost/?q=%s')
url=self._localhost_prefix + '?q=%s')
def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://localhost/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec())
86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py
self.assertEqual('http://localhost/?q=foobar',
self.assertEqual(self._localhost_prefix + '?q=foobar',
def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://localhost/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec())
86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py
new_url='http://localhost/?bar=true&q=%s')
new_url=self._localhost_prefix + '?bar=true&q=%s')
def testEditSearchEngine(self): """Test editing a search engine's properties.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.EditSearchEngine(keyword='foo.com', new_title='bar', new_keyword='bar.com', new_url='http://localhost/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineW...
86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py
self.assertEqual('http://localhost/?bar=true&q=foobar',
self.assertEqual(self._localhost_prefix + '?bar=true&q=foobar',
def testEditSearchEngine(self): """Test editing a search engine's properties.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.EditSearchEngine(keyword='foo.com', new_title='bar', new_keyword='bar.com', new_url='http://localhost/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineW...
86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py
url='http://localhost/?q=%s')
url=self._localhost_prefix + '?q=%s')
def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://localhost/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.c...
86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py
self.assertEqual('http://localhost/?q=foobar',
self.assertEqual(self._localhost_prefix + '?q=foobar',
def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://localhost/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.c...
86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py
self.WaitForInfobarCount(1)
self.assertTrue(self.WaitForInfobarCount(1), 'Did not get save password infobar')
def testDisplayAndSavePasswordInfobar(self): """Verify password infobar displays and able to save password.""" url_https = 'https://www.google.com/accounts/' url_logout = 'https://www.google.com/accounts/Logout' creds = self.GetPrivateInfo()['test_google_account'] username = creds['username'] password = creds['password...
e4b96a7f6b16054caf29140dd2f81df5b5326e09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e4b96a7f6b16054caf29140dd2f81df5b5326e09/passwords.py
while (not found and (firstrun or ((time.time() - start) < 180.0))):
while (running and not found and (firstrun or ((time.time() - start) < 180.0))):
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.
d9df348482272abf9eeb4870bbaadd6e8bf81558 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d9df348482272abf9eeb4870bbaadd6e8bf81558/memcheck_analyze.py
if not found:
if not running and not found: logging.warn("Valgrind process PID = %s is not running but " "its XML log has not been finished correctly." % pid) if running and not found:
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.
d9df348482272abf9eeb4870bbaadd6e8bf81558 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d9df348482272abf9eeb4870bbaadd6e8bf81558/memcheck_analyze.py
'tools', 'layout_tests', 'layout_package', 'lighttpd.conf')
'tools', 'layout_tests', 'webkitpy', 'layout_tests', 'layout_package', 'lighttpd.conf')
def Start(self): if self.IsRunning(): raise 'Lighttpd already running'
d584e8fca55fd66cbfbf74f84c1bff8760a4369c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d584e8fca55fd66cbfbf74f84c1bff8760a4369c/http_server.py
os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS)
os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS and os.path.basename(path) not in EXCLUDED_FILES)
def IsPEFile(path): return (os.path.isfile(path) and os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS)
868525fcd5a697f484454c78cc4754e5fab77a5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/868525fcd5a697f484454c78cc4754e5fab77a5f/checkbins.py
sys.exit(0)
sys.exit(1)
def main(options, args): directory = args[0] pe_total = 0 pe_passed = 0 for file in os.listdir(directory): path = os.path.abspath(os.path.join(directory, file)) if not IsPEFile(path): continue pe = pefile.PE(path, fast_load=True) pe_total = pe_total + 1 success = True # Check for /DYNAMICBASE. if pe.OPTIONAL_HEADER.D...
868525fcd5a697f484454c78cc4754e5fab77a5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/868525fcd5a697f484454c78cc4754e5fab77a5f/checkbins.py
'<a href="/echo">back to referring page</a></div>'
'<a href="http://localhost:8888/echo">back to referring page</a></div>'
def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents."""
a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py
print 'HTTPS server started on port %d...' % server.server_port
print 'HTTPS server started on port %d...' % port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py
print 'HTTP server started on port %d...' % server.server_port
print 'HTTP server started on port %d...' % port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py
listen_port = server.server_port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py
listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port
print 'FTP server started on port %d...' % port
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py
startup_pipe.write(struct.pack('@H', listen_port))
startup_pipe.write("READY")
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py
option_parser.add_option('', '--port', default='0', type='int', help='Port used by the server. If unspecified, the ' 'server will listen on an ephemeral port.')
option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.')
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py
env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard)
if 'GTEST_TOTAL_SHARDS' in env: outer_shards = int(env['GTEST_TOTAL_SHARDS']) outer_index = int(env['GTEST_SHARD_INDEX']) env['GTEST_TOTAL_SHARDS'] = str(self._num_shards * outer_shards) env['GTEST_SHARD_INDEX'] = str((self._num_shards * outer_index) + self._shard) else: env['GTEST_TOTAL_SHARDS'] = str(self._num_s...
def launch(self): env = os.environ.copy() env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard)
52056675802fecba4700aa9bb96a896cb4a9bc37 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/52056675802fecba4700aa9bb96a896cb4a9bc37/parallel_launcher.py
self.assertEqual(1, self.GetBrowserWindowCount(), 'Extensions in failing group: %s' % extensions[curr_extension:group_end])
self.assertTrue(self.GetBrowserWindowCount(), 'Extensions in failing group: %s' % extensions[curr_extension:group_end])
def testExtensionCrashes(self): """Add top extensions; confirm browser stays up when visiting top urls""" self.assertTrue(os.path.exists(self.extensions_dir_), 'The dir "%s" must exist' % os.path.abspath(self.extensions_dir_)) self.assertTrue(os.path.exists(self.urls_file_), 'The file "%s" must exist' % os.path.abspath...
22dc0b2652912b2471a5976edee8c12526284ce7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/22dc0b2652912b2471a5976edee8c12526284ce7/extensions.py
if file_name.endswith(".html"))
if file_name.endswith(".html") and not file_name.startswith("."))
def GetStaticFileNames(): static_files = os.listdir(_static_dir) return set(os.path.splitext(file_name)[0] for file_name in static_files if file_name.endswith(".html"))
6f71a319072f5cb69e406efe6416c91e702a730f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6f71a319072f5cb69e406efe6416c91e702a730f/build.py
ret[new_name] = (correct_semantic_case(semantic) if semantic else old_name_and_type.split(' ')[2])
if semantic: ret[new_name] = correct_semantic_case(semantic) else: ret[new_name] = old_name_and_type.split(' ')[2]
def get_input_mapping(header): ret = dict() for l in header.splitlines(): if not l.startswith('//var'): continue old_name_and_type, semantic, new_name, _, _ = l.split(' : ') if '[' in new_name: new_name = new_name[:new_name.index('[')] if new_name.startswith('$'): new_name = new_name[1:] ret[new_name] = (correct_semant...
a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff/convert.py
header, body = re.split(os.linesep*2, glsl_shader, 1) assert all(l.startswith('//') for l in header.splitlines())
if '\r\n' in glsl_shader: header, body = re.split('\r\n'*2, glsl_shader, 1) else: header, body = re.split(os.linesep*2, glsl_shader, 1) for l in header.splitlines(): assert l.startswith('//')
def fix_glsl(glsl_shader): header, body = re.split(os.linesep*2, glsl_shader, 1) assert all(l.startswith('//') for l in header.splitlines()) input_mapping = get_input_mapping(header) return header + '\n\n' + fix_glsl_body(body, input_mapping)
a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff/convert.py
f = sys.stdin if options.file is None else open(options.file)
if options.file is None: f = sys.stdin else: f = open(options.file)
def main(cg_shader): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff/convert.py
If the 'replace_orig' and 'replace_new' URL query parameters are present, a new string is returned with all occasions of the 'replace_orig' value replaced by the 'replace_new' value.
If the 'replace_text' URL query parameter is present, it is expected to be of the form old_text:new_text, which indicates that any old_text strings in the file are replaced with new_text. Multiple 'replace_text' parameters may be specified.
def _ReplaceFileData(self, data, query_parameters): """Replaces matching substrings in a file.
e6ceef54171f7fd9f12b8ac239adac14fa708cbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e6ceef54171f7fd9f12b8ac239adac14fa708cbd/testserver.py
orig_values = query_dict.get('replace_orig', []) new_values = query_dict.get('replace_new', []) if not orig_values or not new_values: return data orig_value = orig_values[0] new_value = new_values[0] return data.replace(orig_value, new_value)
replace_text_values = query_dict.get('replace_text', []) for replace_text_value in replace_text_values: replace_text_args = replace_text_value.split(':') if len(replace_text_args) != 2: raise ValueError( 'replace_text must be of form old_text:new_text. Actual value: %s' % replace_text_value) old_text_b64, new_text_b64 ...
def _ReplaceFileData(self, data, query_parameters): """Replaces matching substrings in a file.
e6ceef54171f7fd9f12b8ac239adac14fa708cbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e6ceef54171f7fd9f12b8ac239adac14fa708cbd/testserver.py
stack_line = re.compile('\s*@\s*(?:0x)?[0-9a-fA-F]*\s*(\S*)')
stack_line = re.compile('\s*@\s*(?:0x)?[0-9a-fA-F]*\s*([^\n]*)')
def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports.
5687473bc603f0a62ad6ed162b400dc4b8880194 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5687473bc603f0a62ad6ed162b400dc4b8880194/heapcheck_test.py
return 'out'
return '../out'
def PlatformBuildPrefix(self): """Return a platform specific build directory prefix.
4c74d9174de4df13ec25263555fcc64dceb896b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c74d9174de4df13ec25263555fcc64dceb896b8/coverage_posix.py
asynchat.async_chat.__init__(self, sock)
asynchat.async_chat.__init__(self) asyncore.dispatcher.__init__(self, sock, socket_map)
def __init__(self, sock, socket_map, connections, addr): """Starts up the xmpp connection.
4e0792b27048d90ea0dc1f0b98a8b1d1e1656faa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4e0792b27048d90ea0dc1f0b98a8b1d1e1656faa/xmppserver.py
class ForkingHTTPServer(SocketServer.ForkingMixIn, StoppableHTTPServer): """This is a specialization of of StoppableHTTPServer which serves each request in a separate process""" pass class ForkingHTTPSServer(SocketServer.ForkingMixIn, HTTPSServer): """This is a specialization of of HTTPSServer which serves each reque...
def handshake(self, tlsConnection): """Creates the SSL connection.""" try: tlsConnection.handshakeServer(certChain=self.cert_chain, privateKey=self.private_key, sessionCache=self.session_cache) tlsConnection.ignoreAbruptClose = True return True except tlslite.api.TLSError, error: print "Handshake failure:", str(error) ...
6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py
if options.forking: server_class = ForkingHTTPSServer else: server_class = HTTPSServer server = server_class(('127.0.0.1', port), TestPageHandler, options.cert)
server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert)
def main(options, args): # redirect output to a log file so it doesn't spam the unit test output logfile = open('testserver.log', 'w') sys.stderr = sys.stdout = logfile port = options.port # Try to free up the port if there's an orphaned old instance. TryKillingOldServer(port) if options.server_type == SERVER_HTTP: ...
6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py
if options.forking: server_class = ForkingHTTPServer else: server_class = StoppableHTTPServer server = server_class(('127.0.0.1', port), TestPageHandler)
server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler)
def main(options, args): # redirect output to a log file so it doesn't spam the unit test output logfile = open('testserver.log', 'w') sys.stderr = sys.stdout = logfile port = options.port # Try to free up the port if there's an orphaned old instance. TryKillingOldServer(port) if options.server_type == SERVER_HTTP: ...
6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py
option_parser.add_option('--forking', action='store_true', default=False, dest='forking', help='Serve each request in a separate process.')
def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0)
6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py
num_invalid_values = arg.GetNumInvalidValues()
num_invalid_values = arg.GetNumInvalidValues(func)
def WriteInvalidUnitTest(self, func, file, test, extra = {}): """Writes a invalid unit test.""" arg_index = 0 for arg in func.GetOriginalArgs(): num_invalid_values = arg.GetNumInvalidValues() for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" gl_error = None count = 0 for arg in...
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
"""Writes the GLES2 Implemention declaration."""
"""Writes the GLES2 Implemention."""
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention declaration.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) f...
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
self.WriteGLES2ImplementationDeclaration(func, file)
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention declaration.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) f...
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" Wa...
impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Wri...
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sres...
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file)
code = """%(return_type)s %(func_name)s(%(args)s) { helper_->SetBucketSize(kResultBucketId, 0); helper_->%(func_name)s(%(id_name)s, kResultBucketId); std::string str; if (GetBucketAsString(kResultBucketId, &str)) { GLsizei max_size = std::min(static_cast<size_t>(%(bufsize_name)s) - 1, str.size()); if (%(length_name)s !...
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file)
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
file.Write("// TODO(gman): %s\n\n" % func.name) def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name)
valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { const char* kInfo = "hello"; const uint32 kBucketId = 123; SpecializedSetup<%(name)s, 0>(); %(expect_len_code)s EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)) .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)), SetArrayArgument<3>(kInfo, kInfo + strlen(kIn...
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name)
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_last_2_args: arg.WriteGetCode(file) self.WriteGetDataSizeCode(func, file) size_arg = args[-2] file.Write(" uint32 size_shm_id = c.%s_shm_id;\n" % size_arg.name) file.Write(" uint32 size_shm_offset = c.%s_shm_offset;\n" % size_arg.name) f...
args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* ...
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_l...
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
" %s %s = GetSharedMemoryAs<%s>(\n" % (dest_arg.type, dest_arg.name, dest_arg.type)) file.Write( " c.%s_shm_id, c.%s_shm_offset, %s);\n" % (dest_arg.name, dest_arg.name, bufsize_arg.name)) for arg in all_but_last_2_args + [dest_arg]: arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerIm...
" %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name))
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_l...
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" return 0
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
if self.type == 'GLsizei' or self.type == 'GLsizeiptr': file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
pass def WriteClientSideValidationCode(self, file): """Writes the validation code for an argument.""" pass
def WriteValidationCode(self, file): """Writes the validation code for an argument.""" if self.type == 'GLsizei' or self.type == 'GLsizeiptr': file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self): """overridden from Argument.""" return 1
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
"""returns an invalid value and expected parse result by index."""
"""overridden from Argument."""
def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("-1", "kNoError", "GL_INVALID_VALUE")
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
"""Base calss for EnumArgument, IntArgument and BoolArgument"""
"""Base class for EnumArgument, IntArgument and BoolArgument"""
def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("-1", "kNoError", "GL_INVALID_VALUE")
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] return len(invalid) return 0
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
return (invalid[index], "kNoError", "GL_INVALID_ENUM") return ("---ERROR1---", "kNoError", "GL_INVALID_ENUM")
return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_error)
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError", "GL_INVALID_ENUM") return ("---ERROR1---", "kNoError", "GL_...
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self): """Overridden from Argument.""" return 2
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
def _GetTestsFromName(name):
def _ImportTestsFromName(name):
def _GetTestsFromName(name): """Get a list of all test names from the given string.
f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py
map(self._GetTestsFromName, all_tests_modules))
map(self._ImportTestsFromName, all_tests_modules))
def _ListMissingTests(self): """Print tests missing from PYAUTO_TESTS.""" # Fetch tests from all test scripts all_test_files = filter(lambda x: x.endswith('.py'), os.listdir(self.TestsDir())) all_tests_modules = [os.path.splitext(x)[0] for x in all_test_files] all_tests = reduce(lambda x, y: x + y, map(self._GetTestsFr...
f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py
map(self._GetTestsFromName, self._LoadTestNamesFrom(pyauto_tests_file)))
map(self._ImportTestsFromName, self._ExpandTestNamesFrom(pyauto_tests_file, self._options.suite)))
def _ListMissingTests(self): """Print tests missing from PYAUTO_TESTS.""" # Fetch tests from all test scripts all_test_files = filter(lambda x: x.endswith('.py'), os.listdir(self.TestsDir())) all_tests_modules = [os.path.splitext(x)[0] for x in all_test_files] all_tests = reduce(lambda x, y: x + y, map(self._GetTestsFr...
f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py
def _LoadTests(self, args): """Returns a suite of tests loaded from the given args.
def _ExpandTestNames(self, args): """Returns a list of tests loaded from the given args.
def _LoadTests(self, args): """Returns a suite of tests loaded from the given args.
f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py