rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
port_names = ["chromium-mac", "chromium", "mac" + self.version(), "mac"]
port_names = [ "chromium-mac" + self.version(), "chromium-mac", "chromium", "mac" + self.version(), "mac", ]
def baseline_search_path(self): port_names = ["chromium-mac", "chromium", "mac" + self.version(), "mac"] return map(self._webkit_baseline_path, port_names)
server_data = { 'port': listen_port } server_data_json = json.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(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...
startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(server_data_json)
startup_pipe.write(struct.pack('@H', listen_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...
if is_sane: return return_code else:
if check_sanity and not is_sane:
def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports.
Reviewer("David Hyatt", "hyatt@apple.com", "harrison"),
Reviewer("David Hyatt", "hyatt@apple.com", "hyatt"),
def __init__(self, name, email_or_emails, irc_nickname=None): Committer.__init__(self, name, email_or_emails, irc_nickname) self.can_review = True
_sync_handler = chromiumsync.TestServer()
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.KillHandler, self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpires...
http_response, raw_reply = self._sync_handler.HandleCommand(raw_request)
if not self.server._sync_handler: import chromiumsync self.server._sync_handler = chromiumsync.TestServer() http_response, raw_reply = self.server._sync_handler.HandleCommand( raw_request)
def ChromiumSyncCommandHandler(self): """Handle a chromiumsync command arriving via http.
paths = [arg for arg in args if arg and arg != '']
paths = [self._strip_test_dir_prefix(arg) for arg in args if arg and arg != '']
def collect_tests(self, args, last_unexpected_results): """Find all the files to test.
index = test_file.rfind(os.sep + 'LayoutTests' + os.sep) test_file = test_file[index + len('LayoutTests/'):]
index = test_file.rfind(os.sep + LAYOUT_TESTS_DIRECTORY) test_file = test_file[index + len(LAYOUT_TESTS_DIRECTORY):]
def _get_dir_for_test_file(self, test_file): """Returns the highest-level directory by which to shard the given test file.""" index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
self._proc.stdin.write(cmd) line = self._proc.stdout.readline() while line.rstrip() != "
try: self._proc.stdin.write(cmd) line = self._proc.stdout.readline() except IOError, e: _log.error("IOError communicating w/ test_shell: " + str(e)) crash = True while not crash and line.rstrip() != "
def run_test(self, uri, timeoutms, checksum): output = [] error = [] crash = False timeout = False actual_uri = None actual_checksum = None
line = self._proc.stdout.readline()
try: line = self._proc.stdout.readline() except IOError, e: _log.error("IOError while reading: " + str(e)) crash = True
def run_test(self, uri, timeoutms, checksum): output = [] error = [] crash = False timeout = False actual_uri = None actual_checksum = None
O3D_PLUGIN_NAME = 'O3D Plugin'
O3D_PLUGIN_NAME = FLAGS.set_name
def main(argv): try: files = FLAGS(argv) # Parse flags except gflags.FlagsError, e: print '%s.\nUsage: %s [<options>] [<input_file> <output_file>]\n%s' % \ (e, sys.argv[0], FLAGS) sys.exit(1) # Strip off argv[0] files = files[1:] # Get version string from o3d_version.py o3d_version_vars = {} if FLAGS.kill_switch: ex...
O3D_PLUGIN_MIME_TYPE = 'application/vnd.o3d.auto' if FLAGS.name: print '%s' % O3D_PLUGIN_NAME sys.exit(0)
O3D_PLUGIN_MIME_TYPE = FLAGS.set_mimetype
def main(argv): try: files = FLAGS(argv) # Parse flags except gflags.FlagsError, e: print '%s.\nUsage: %s [<options>] [<input_file> <output_file>]\n%s' % \ (e, sys.argv[0], FLAGS) sys.exit(1) # Strip off argv[0] files = files[1:] # Get version string from o3d_version.py o3d_version_vars = {} if FLAGS.kill_switch: ex...
sys.exit(0) if FLAGS.mimetype: print '%s' % O3D_PLUGIN_MIME_TYPE
def main(argv): try: files = FLAGS(argv) # Parse flags except gflags.FlagsError, e: print '%s.\nUsage: %s [<options>] [<input_file> <output_file>]\n%s' % \ (e, sys.argv[0], FLAGS) sys.exit(1) # Strip off argv[0] files = files[1:] # Get version string from o3d_version.py o3d_version_vars = {} if FLAGS.kill_switch: ex...
return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"])
return self.SimpleTest("chrome", "remoting_unittests")
def TestRemoting(self): return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"])
(self._test_args.new_baseline or self._test_args.reset_results)):
(self._test_args.new_baseline or self._test_args.reset_results or not self._options.pixel_tests)):
def _run_test(self, test_info): """Run a single test file using a shared DumpRenderTree process.
if not IsLinux():
if not common.IsLinux():
def Create(self, tool_name): if tool_name == "memcheck": return Memcheck() if tool_name == "memcheck_wine": return Memcheck() if tool_name == "tsan": if not IsLinux(): logging.info("WARNING: ThreadSanitizer may be unstable on Mac.") logging.info("See http://code.google.com/p/data-race-test/wiki/" "ThreadSanitizerOnMacO...
startup_pipe.write(struct.pack('@H', listen_port))
startup_pipe.write(struct.pack('@H', server_data['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...
file = self.path[len(prefix):] if file.find('?') > -1: url, querystring = file.split('?') else: url = file entries = url.split('/') path = os.path.join(self.server.data_dir, *entries) if os.path.isdir(path): path = os.path.join(path, 'index.html') if not os.path.isfile(path): print "File not found " + file + " full p...
_, _, url_path, _, query, _ = urlparse.urlparse(self.path) sub_path = url_path[len(prefix):] entries = sub_path.split('/') file_path = os.path.join(self.server.data_dir, *entries) if os.path.isdir(file_path): file_path = os.path.join(file_path, 'index.html') if not os.path.isfile(file_path): print "File not found " + ...
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
f = open(path, "rb")
f = open(file_path, "rb")
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
headers_path = path + '.mock-http-headers'
headers_path = file_path + '.mock-http-headers'
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
self.send_header('Content-type', self.GetMIMETypeFromName(file))
self.send_header('Content-type', self.GetMIMETypeFromName(file_path))
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
path = os.path.join(options.results_directory, 'LayoutTests') if os.path.exists(path): shutil.rmtree(path)
meter.update("Clobbering old results in %s" % options.results_directory) layout_tests_dir = port_obj.layout_tests_dir() possible_dirs = os.listdir(layout_tests_dir) for dirname in possible_dirs: if os.path.isdir(os.path.join(layout_tests_dir, dirname)): shutil.rmtree(os.path.join(options.results_directory, dirname), ig...
def main(options, args): """Run the tests. Will call sys.exit when complete. Args: options: a dictionary of command line options args: a list of sub directories or files to test """ if options.sources: options.verbose = True # Set up our logging format. meter = metered_stream.MeteredStream(options.verbose, sys.stde...
print "ERROR: third_party/WebKit appears to not be under git control."
if os.path.exists('third_party/WebKit'): print "ERROR: third_party/WebKit appears to not be under git control." else: print "ERROR: third_party/WebKit could not be found." print "Did you run this script from the right directory?"
def main(): if not os.path.exists('third_party/WebKit/.git'): print "ERROR: third_party/WebKit appears to not be under git control." print "See http://code.google.com/p/chromium/wiki/UsingWebKitGit for" print "setup instructions." return webkit_rev = GetWebKitRev() print 'Desired revision: r%s.' % webkit_rev os.chdir(...
test_prefixes = ["FLAKY", "FAILS", "MAYBE"]
test_prefixes = ["FLAKY", "FAILS"]
def _ReadGtestFilterFile(self, name, cmd): '''Read a file which is a list of tests to filter out with --gtest_filter and append the command-line option to cmd. ''' filters = [] for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%...
def CheckChangeOnUpload(input_api, output_api):
_LICENSE_HEADER = ( r".*? Copyright \(c\) 20\d\d The Chromium Authors\. All rights reserved\." "\n" r".*? Use of this source code is governed by a BSD-style license that can " "be\n" r".*? found in the LICENSE file\." "\n" ) def _CommonChecks(input_api, output_api):
def CheckChangeOnUpload(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py Inp...
black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) result...
results.extend(_CommonChecks(input_api, output_api))
def CheckChangeOnCommit(input_api, output_api): results = [] black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks....
default=None, help="Use DumpRenderTree instead of test_shell"),
default=True, help="(DEPRECATED)"),
def parse_args(args=None): """Provides a default set of command line args. Returns a tuple of options, args from optparse""" # FIXME: All of these options should be stored closer to the code which # FIXME: actually uses them. configuration_options should move # FIXME: to WebKitPort and be shared across all scripts. c...
os.lseek(fd, size, os.SEEK_SET)
os.lseek(fd, size, 0)
def testBigZip(self): """Verify that we can download a 1GB file.
_remove_expected_call_re = re.compile(r' EXPECT_CALL.*?;\n', re.S)
def Close(self): self.Write("#endif // %s\n\n" % self.guard) CWriter.Close(self)
if func.GetInfo('expection') == False: test = self._remove_expected_call_re.sub('', test)
def WriteValidUnitTest(self, func, file, test, extra = {}): """Writes a valid unit test.""" if func.GetInfo('expection') == False: test = self._remove_expected_call_re.sub('', test) name = func.name arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): arg_strings.append(arg.GetValidArg(count, 0)) count += 1 gl...
num_invalid_values = arg.GetNumInvalidValues(func)
num_invalid_values = arg.GetNumInvalidValues()
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(func) for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" gl_error = None count = 0 for ar...
def WriteGLES2ImplementationDeclaration(self, func, file):
def WriteGLES2ImplementationHeader(self, func, file):
def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
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."""
def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
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...
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...
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'])
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" ...
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'))
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) {
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 = """
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...
" %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...
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 0
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
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1
if func.is_immediate: return 0
def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1
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")
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
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_...
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func): """Overridden from Argument.""" return 2
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...
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
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
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)
return ('/tmp/run-chromium-webkit-tests-' + self._options.results_directory)
return self._build_path(self._options.results_directory)
def results_directory(self): # FIXME: Why do we say chromium here? Maybe "new-run-webkit-tests-"? return ('/tmp/run-chromium-webkit-tests-' + self._options.results_directory)
def WriteGLES2ImplementationImpl(self, func, file): """Writes the GLES2 Implemention definition.""" if not func.can_auto_generate: file.Write("%s GLES2Implementation::%s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) if not func.return_type == "void": file.Write(" return 0;\n")...
def WriteGLES2ImplementationImpl(self, func, file): """Writes the GLES2 Implemention definition.""" if not func.can_auto_generate: file.Write("%s GLES2Implementation::%s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) if not func.return_type == "void": file.Write(" return 0;\n")...
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" MakeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func...
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" GLuint client_id;\n") file.Write(" MakeIds(1, &client_id);\n") file.Write(" helper_->%s(%s);\n" % (func.name,...
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) all_but_last_args = func.GetOriginalArgs()[:-1] arg_string = ( ", ".join(["%s" % arg.name for arg in all_but_last_args])) fil...
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" // TODO(gman): This needs to change to use SendString.\n") file.Write(" helper_->%sImmediate(%s);\n" % (func.n...
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
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...
def WriteGLES2ImplementationImpl(self, file): """Writes the GLES2 Implemention definition.""" self.type_handler.WriteGLES2ImplementationImpl(self, file)
def WriteGLES2ImplementationImpl(self, file): """Writes the GLES2 Implemention definition.""" self.type_handler.WriteGLES2ImplementationImpl(self, file)
def WriteGLES2ImplementationImpl(self, filename): """Writes the gles2 helper implementation.""" file = CHeaderWriter( filename, "// A class to emluate GLES2 over command buffers.\n") file.Write( " self.WriteNamespaceOpen(file) for func in self.original_functions: func.WriteGLES2ImplementationImpl(file) file.Write("\n")...
def WriteGLES2ImplementationImpl(self, filename): """Writes the gles2 helper implementation.""" file = CHeaderWriter( filename, "// A class to emluate GLES2 over command buffers.\n") file.Write( "#include \"gpu/command_buffer/client/gles2_implementation.h\"\n") self.WriteNamespaceOpen(file) for func in self.original_fu...
if options.generate_implementation_templates: gen.WriteGLES2ImplementationImpl("client/gles2_implementation_gen.h")
def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ...
def add_patch_to_bug(self, bug_id, patch_file_object, description, comment_text=None, mark_for_review=False, mark_for_commit_queue=False):
def add_patch_to_bug(self, bug_id, patch_file_object, description, comment_text=None, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=False):
def add_patch_to_bug(self, bug_id, patch_file_object, description, comment_text=None, mark_for_review=False, mark_for_commit_queue=False): self.authenticate()
self._fill_attachment_form(description, patch_file_object, mark_for_review=mark_for_review, mark_for_commit_queue=mark_for_commit_queue, bug_id=bug_id)
self._fill_attachment_form(description, patch_file_object, mark_for_review=mark_for_review, mark_for_commit_queue=mark_for_commit_queue, mark_for_landing=mark_for_landing, bug_id=bug_id)
def add_patch_to_bug(self, bug_id, patch_file_object, description, comment_text=None, mark_for_review=False, mark_for_commit_queue=False): self.authenticate()
'%s seems to contain a definition of DllRegisterServer.\n'
'%s contains a definition of DllRegisterServer at line %s.\n'
def CheckNoDllRegisterServer(input_api, output_api): for f, line_num, line in input_api.RightHandSideLines(): if DLL_REGISTER_SERVER_RE.search(line): file_name = os.path.basename(f.LocalPath()) if file_name not in ['install_utils.h', 'install_utils_unittest.cc']: return [output_api.PresubmitError( '%s seems to contain ...
f.LocalPath())]
(f.LocalPath(), line_num))]
def CheckNoDllRegisterServer(input_api, output_api): for f, line_num, line in input_api.RightHandSideLines(): if DLL_REGISTER_SERVER_RE.search(line): file_name = os.path.basename(f.LocalPath()) if file_name not in ['install_utils.h', 'install_utils_unittest.cc']: return [output_api.PresubmitError( '%s seems to contain ...
def __init__(self, methodName='runTest', extra_chrome_flags=None):
def __init__(self, methodName='runTest', **kwargs):
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
extra_chrome_flags: additional flags to pass when launching chrome
(The rest of the args can be in any order. They can even be skipped in which case the defaults will be used.) extra_chrome_flags: additional flags to pass when launching chrome. Defaults to None clear_profile: If True, clean the profile dir before use. Defaults to True homepage: the home page. Defaults to "about:blank...
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
if extra_chrome_flags is not None:
if extra_chrome_flags:
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
pyautolib.PyUITestSuite.__init__(self, args)
pyautolib.PyUITestSuite.__init__(self, args, clear_profile, homepage)
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
self.assertTrue(passing_run(['--platform', 'dryrun-mac', 'fast/html'])) self.assertTrue(passing_run(['--platform', 'dryrun-chromium-mac', 'fast/html'])) self.assertTrue(passing_run(['--platform', 'dryrun-chromium-win', 'fast/html'])) self.assertTrue(passing_run(['--platform', 'dryrun-chromium-linux', 'fast/html']))
def test_basics(self): self.assertTrue(passing_run(['--platform', 'dryrun', 'fast/html'])) self.assertTrue(passing_run(['--platform', 'dryrun-mac', 'fast/html'])) self.assertTrue(passing_run(['--platform', 'dryrun-chromium-mac', 'fast/html'])) self.assertTrue(passing_run(['--platform', 'dryrun-chromium-win', 'fast/html...
work_queue = QueueEngine("trivial-queue", delegate, threading.Event()) work_queue.run()
self._run_engine(delegate)
def test_trivial(self): delegate = LoggingDelegate(self) work_queue = QueueEngine("trivial-queue", delegate, threading.Event()) work_queue.run() self.assertEquals(delegate.stop_message, "Delegate terminated queue.") self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks) self.assertTrue(os.path.exist...
work_queue = QueueEngine("error-queue", delegate, threading.Event()) work_queue.run()
self._run_engine(delegate)
def test_unexpected_error(self): delegate = RaisingDelegate(self, ScriptError(exit_code=3)) work_queue = QueueEngine("error-queue", delegate, threading.Event()) work_queue.run() expected_callbacks = LoggingDelegate.expected_callbacks[:] work_item_index = expected_callbacks.index('process_work_item') # The unexpected er...
work_queue = QueueEngine("handled-error-queue", delegate, threading.Event()) work_queue.run()
self._run_engine(delegate)
def test_handled_error(self): delegate = RaisingDelegate(self, ScriptError(exit_code=QueueEngine.handled_error_code)) work_queue = QueueEngine("handled-error-queue", delegate, threading.Event()) work_queue.run() self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
def _test_terminating_queue(self, exception, expected_message):
def _run_engine(self, delegate, engine=None, termination_message=None): if not engine: engine = QueueEngine("test-queue", delegate, threading.Event()) if not termination_message: termination_message = "Delegate terminated queue." expected_stderr = "\n%s\n" % termination_message OutputCapture().assert_outputs(self, engi...
def _test_terminating_queue(self, exception, expected_message): work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item') # The terminating error should be handled right after process_work_item. # There should be no other callbacks after stop_work_queue. expected_callbacks = LoggingDelegate.expect...
work_queue = QueueEngine("terminating-queue", delegate, threading.Event()) output = OutputCapture() expected_stderr = "\n%s\n" % expected_message output.assert_outputs(self, work_queue.run, [], expected_stderr=expected_stderr)
self._run_engine(delegate, termination_message=termination_message)
def _test_terminating_queue(self, exception, expected_message): work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item') # The terminating error should be handled right after process_work_item. # There should be no other callbacks after stop_work_queue. expected_callbacks = LoggingDelegate.expect...
self.assertEquals(delegate.stop_message, expected_message)
self.assertEquals(delegate.stop_message, termination_message)
def _test_terminating_queue(self, exception, expected_message): work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item') # The terminating error should be handled right after process_work_item. # There should be no other callbacks after stop_work_queue. expected_callbacks = LoggingDelegate.expect...
work_queue = FastQueueEngine(delegate) work_queue.run()
self._run_engine(delegate, engine=FastQueueEngine(delegate))
def test_not_safe_to_proceed(self): delegate = NotSafeToProceedDelegate(self) work_queue = FastQueueEngine(delegate) work_queue.run() expected_callbacks = LoggingDelegate.expected_callbacks[:] expected_callbacks.remove('work_item_log_path') expected_callbacks.remove('process_work_item') self.assertEquals(delegate._call...
for current_name in MATRIX_UNIFORM_NAMES: if lower_name == current_name.lower(): return current_name return lower_name
return MATRIX_UNIFORM_NAMES_MAPPING.get(lower_name, lower_name)
def correct_semantic_case(name): lower_name = name.lower() for current_name in MATRIX_UNIFORM_NAMES: if lower_name == current_name.lower(): return current_name return lower_name
def run_page_cycler(self, gtest_filter = ''): assert(gtest_filter != ''), gtest_filter+' cannot be empty!' cmd = ('CR_SOURCE_ROOT=/home/chronos/chromium/src /home/chronos/' 'chromium/src/x86-generic_out/Release/page_cycler_tests' ' --gtest_filter=')+gtest_filter xcmd = site_ui.xcommand(cmd) logging.debug('Running: '+g...
@return - the percentile of the values """ if not N: return None k = (len(N)-1) * percent f = math.floor(k) c = math.ceil(k) if f == c: return key(N[int(k)]) d0 = key(N[int(f)]) * (k-f) d1 = key(N[int(c)]) * (c-k) return d0+d1
def run_page_cycler(self, gtest_filter = ''): # TODO: Disable screensaver? assert(gtest_filter != ''), gtest_filter+' cannot be empty!' cmd = ('CR_SOURCE_ROOT=/home/chronos/chromium/src /home/chronos/' 'chromium/src/x86-generic_out/Release/page_cycler_tests' ' --gtest_filter=')+gtest_filter xcmd = site_ui.xcommand(cmd)...
def run_once(self): testNames=['PageCyclerTest.Alexa_usFile', 'PageCyclerTest.MozFile', 'PageCyclerTest.Intl1File', 'PageCyclerTest.Intl2File', 'PageCyclerTest.DhtmlFile', 'PageCyclerTest.Moz2File', 'PageCyclerTest.BloatFile', 'PageCyclerTest.DomFile', 'PageCyclerTest.MorejsFile', 'PageCyclerTest.MorejsnpFile'] for t...
def mean(numbers): assert(len(numbers) != 0), 'list should not be empty!' return sum(numbers)/len(numbers) class PageCyclerResultsParser: def parse_file(self, outfile = 'out.txt'): output = open(outfile).read() return self.parse_results(output) def parse_results(self, output = ''): median = functools.partial(percen...
def run_once(self): # Use a smaller input set for testing purposes, if needed:
current_dir = input_api.PresubmitLocalPath()
current_dir = str(input_api.PresubmitLocalPath())
def LintTestFiles(input_api, output_api): current_dir = input_api.PresubmitLocalPath() # Set 'webkit/tools/layout_tests' in include path. python_paths = [ current_dir, input_api.os_path.join(current_dir, '..', '..', '..', 'tools', 'python') ] env = input_api.environ.copy() if env.get('PYTHONPATH'): python_paths.append(...
default=False,
default=None,
def parse_args(args=None): """Provides a default set of command line args. Returns a tuple of options, args from optparse""" # FIXME: All of these options should be stored closer to the code which # FIXME: actually uses them. configuration_options should move # FIXME: to WebKitPort and be shared across all scripts. c...
logging.error('Unexpected line change without file path declaration: %r' % line)
_log.error('Unexpected line change without file path ' 'declaration: %r' % line)
def __init__(self, diff_input): """Parses a diff.
logging.error('Unexpected diff format when parsing a chunk: %r' % line)
_log.error('Unexpected diff format when parsing a ' 'chunk: %r' % line)
def __init__(self, diff_input): """Parses a diff.
(arg_string, parse_result) = arg.GetInvalidArg(count, value_index)
(arg_string, parse_result, gl_error) = arg.GetInvalidArg( count, value_index)
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" count = 0 for arg in func.GetOrigina...
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));%(gl_error_test)s
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
ExecuteImmediateCmd(cmd, sizeof(temp)));
ExecuteImmediateCmd(cmd, sizeof(temp)));%(gl_error_test)s
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
return ("---ERROR0---", "---ERROR2---")
return ("---ERROR0---", "---ERROR2---", None)
def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("---ERROR0---", "---ERROR2---")
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
return (invalid[index], "kNoError") return ("---ERROR1---", "kNoError")
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") return ("---ERROR1---", "kNoError")
return ("kInvalidSharedMemoryId, 0", "kOutOfBounds")
return ("kInvalidSharedMemoryId, 0", "kOutOfBounds", None)
def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: return ("kInvalidSharedMemoryId, 0", "kOutOfBounds") else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", "kOutOfBounds")