rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
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 != NULL) { *%(length_name)s = max_size;
if (bufsize > 0) { 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 != NULL) { *%(length_name)s = max_size; } memcpy(%(dest_name)s, str.c_str(), max_size); %(dest_name)s[max_size] = '\\0';
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
memcpy(%(dest_name)s, str.c_str(), max_size); %(dest_name)s[max_size] = '\\0';
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
self._print_one_line_summary(result_summary.total, result_summary.expected)
if LOG_SUMMARY in self._options.log: self._print_one_line_summary(result_summary.total, result_summary.expected)
def run(self, result_summary, print_results): """Run all our tests on all our test files.
self._print_unexpected_results(unexpected_results)
if LOG_UNEXPECTED_RESULTS in self._options.log: self._print_unexpected_results(unexpected_results)
def run(self, result_summary, print_results): """Run all our tests on all our test files.
self._display_one_line_progress(result_summary)
if LOG_PROGRESS in self._options.log: self._display_one_line_progress(result_summary)
def update_summary(self, result_summary): """Update the summary while running tests.""" while True: try: (test, fail_list) = self._result_queue.get_nowait() result = test_failures.determine_result_type(fail_list) expected = self._expectations.matches_an_expected_result(test, result, self._options.pixel_tests) result_su...
default="detailed-progress,unexpected", help="log various types of data. The param should be a " + "comma-separated list of values from: " + "actual,config," + LOG_DETAILED_PROGRESS + ",expected,timing," + LOG_UNEXPECTED + " " + "(defaults to " + "--log detailed-progress,unexpected)"), optparse.make_option("-v", "--ver...
default=LOG_DEFAULT_VALUE, help=("log various types of data. The argument value should be a " "comma-separated list of values from: %s (defaults to " "--log %s)" % (LOG_VALUES, LOG_DEFAULT_VALUE))), optparse.make_option("-v", "--verbose", action="store_true",
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...
options.configuration = "release"
options.configuration = "Release"
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma de...
(error.__hash__() & 0xffffffffffffffff)
(error.__hash__() & 0xffffffffffffffff))
def Report(self, files, check_sanity=False): '''Reads in a set of files and prints Memcheck report.
test_info.image_hash())
image_hash)
def _covered_run(self): # FIXME: this is a separate routine to work around a bug # in coverage: see http://bitbucket.org/ned/coveragepy/issue/85. test_info = self._test_info self._driver = self._port.create_driver(self._test_args.png_path, self._options) self._driver.start() start = time.time() crash, timeout, actual_c...
image_hash = test_info.image_hash() if (image_hash and (self._test_args.new_baseline or self._test_args.reset_results or not self._options.pixel_tests)): image_hash = ""
image_hash = _image_hash(test_info, self._test_args, self._options)
def _run_test(self, test_info): """Run a single test file using a shared DumpRenderTree process.
'<a href="http://localhost:8888/echo">back to referring page</a></div>'
'<a href="/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."""
print 'HTTPS server started on port %d...' % port
print 'HTTPS server started on port %d...' % 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...
print 'HTTP server started on port %d...' % port
print 'HTTP server started on port %d...' % 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...
print 'FTP server started on port %d...' % port
listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % 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...
startup_pipe.write("READY")
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...
option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.')
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.')
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...
default=PRINT_DEFAULT,
def print_options(): return [ # Note: we use print_options rather than just 'print' because print # is a reserved word. optparse.make_option("--print", dest="print_options", default=PRINT_DEFAULT, help=("controls print output of test run. " "Use --help-printing for more.")), optparse.make_option("--help-printing", acti...
def parse_print_options(print_options, child_processes, is_fully_parallel):
def parse_print_options(print_options, verbose, child_processes, is_fully_parallel):
def parse_print_options(print_options, child_processes, is_fully_parallel): """Parse the options provided to --print and dedup and rank them. Returns a set() of switches that govern how logging is done """ switches = set(print_options.split(',')) if 'nothing' in switches: return set() if (child_processes != 1 and n...
switches = set(print_options.split(','))
if print_options: switches = set(print_options.split(',')) elif verbose: switches = set(PRINT_EVERYTHING.split(',')) else: switches = set(PRINT_DEFAULT.split(','))
def parse_print_options(print_options, child_processes, is_fully_parallel): """Parse the options provided to --print and dedup and rank them. Returns a set() of switches that govern how logging is done """ switches = set(print_options.split(',')) if 'nothing' in switches: return set() if (child_processes != 1 and n...
child_processes, is_fully_parallel)
options.verbose, child_processes, is_fully_parallel)
def __init__(self, port, options, regular_output, buildbot_output, child_processes, is_fully_parallel): """ Args port interface to port-specific routines options OptionParser object with command line settings regular_output stream to which output intended only for humans should be written b...
return '/usr/sbin/apache2'
if self._is_redhat_based(): return '/usr/sbin/httpd' else: return '/usr/sbin/apache2'
def _path_to_apache(self): return '/usr/sbin/apache2'
'apache2-debian-httpd.conf')
config_name)
def _path_to_apache_config_file(self): return os.path.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-debian-httpd.conf')
return '/usr/bin/wdiff'
if self._is_redhat_based(): return '/usr/bin/dwdiff' else: return '/usr/bin/wdiff' def _is_redhat_based(self): return os.path.exists(os.path.join('/etc', 'redhat-release'))
def _path_to_wdiff(self): return '/usr/bin/wdiff'
test_types = individual_test_timings[0].time_for_diffs.keys()
test_types = [] if individual_test_timings: test_types = individual_test_timings[0].time_for_diffs.keys()
def _print_aggregate_test_statistics(self, write, individual_test_timings): """Prints aggregate statistics (e.g. median, mean, etc.) for all tests. Args: write: A callback to write info to (e.g., a LoggingWriter) or sys.stdout.write. individual_test_timings: List of dump_render_tree_thread.TestStats for all tests. """ ...
self._buildbot_stream.write("%s\n" % "-" * 78)
self._buildbot_stream.write("%s\n" % ("-" * 78))
def print_unexpected_results(self, unexpected_results): """Prints a list of the unexpected results to the buildbot stream.""" if self.disabled('unexpected-results'): return
request.connection.write('ThisWillCauseHandshakeError')
request.connection.write('ThisWillCauseHandshakeError\r\n')
def web_socket_do_extra_handshake(request): request.connection.write('ThisWillCauseHandshakeError')
logging.debug('thread %s starting' % (self.getName()))
logging.debug('%s starting' % (self.getName()))
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self....
logging.debug('thread %s done (%d tests)' % (self.getName(),
logging.debug('%s done (%d tests)' % (self.getName(),
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self....
logging.error('thread %s dying: %s' % (self.getName(),
logging.error('%s dying: %s' % (self.getName(),
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self....
logging.debug("%s failed:\n%s" % (path_utils.RelativeTestFilename(filename), error_str))
logging.debug("%s %s failed:\n%s" % (self.getName(), path_utils.RelativeTestFilename(filename), error_str))
def _Run(self, test_runner, result_summary): """Main work entry point of the thread. Basically we pull urls from the filename queue and run the tests until we run out of urls.
logging.debug(path_utils.RelativeTestFilename(filename) + " passed")
logging.debug("%s %s passed" % (self.getName(), path_utils.RelativeTestFilename(filename)))
def _Run(self, test_runner, result_summary): """Main work entry point of the thread. Basically we pull urls from the filename queue and run the tests until we run out of urls.
Committer("Victor Wong", "victorw@chromium.org"),
Committer("Victor Wang", "victorw@chromium.org"),
def __init__(self, name, email_or_emails): Committer.__init__(self, name, email_or_emails) self.can_review = True
with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive:
archive = tarfile.open(output_fullname, 'w:bz2') try:
def ShouldExcludePath(path): head, tail = os.path.split(path) if tail in ('.svn', '.git'): return True
path_utils.ChromiumBaselinePath(platform), expected_filename)
path_utils.ChromiumBaselinePath(platform), "LayoutTests", expected_filename)
def _ExtractAndAddNewBaselines(self, archive_file): """Extract new baselines from archive and add them to SVN repository.
if func.GetInfo('needs_size'):
if func.GetInfo('needs_size') and not func.name.endswith('Bucket'):
def InitFunction(self, func): """Add or adjust anything type specific for this function.""" if func.GetInfo('needs_size'): func.AddCmdArg(DataSizeArgument('data_size'))
return self
return BucketPointerArgument(self.name, self.type)
def GetBucketVersion(self): """Overridden from Argument.""" if self.type == "const char*": return InputStringBucketArgument(self.name, self.type) return self
def InitFunction(self): """Overridden from Function""" pass
def InitFunction(self): """Overridden from Function""" pass
pass
self.type_handler.WriteBucketServiceImplementation(self, file)
def WriteServiceImplementation(self, file): """Overridden from Function""" pass
return file.read()
return file.read() + drt_overrides
def test_expectations_overrides(self): try: overrides_path = self.path_from_chromium_base('webkit', 'tools', 'layout_tests', 'test_expectations.txt') except AssertionError: return None if not os.path.exists(overrides_path): return None with codecs.open(overrides_path, "r", "utf-8") as file: return file.read()
self._chrome_zip_name = 'chrome-%s' % { 'linux': 'linux',
self._chrome_zip_name = 'chrome-%s' % { 'linux64': 'linux64bit', 'linux32': 'linux32bit',
def _ParseArgs(self): parser = optparse.OptionParser() parser.add_option( '-d', '--outdir', type='string', default=None, help='Directory in which to setup. This is typically the directory ' 'where the binaries would go when compiled from source.') parser.add_option( '-p', '--platform', type='string', default=pyauto_uti...
{ 'linux': 'lib.target/_pyautolib.so',
{ 'linux64': 'lib.target/_pyautolib.so', 'linux32': 'lib.target/_pyautolib.so',
def _ParseArgs(self): parser = optparse.OptionParser() parser.add_option( '-d', '--outdir', type='string', default=None, help='Directory in which to setup. This is typically the directory ' 'where the binaries would go when compiled from source.') parser.add_option( '-p', '--platform', type='string', default=pyauto_uti...
{ 'linux': '_pyautolib.so',
{ 'linux64': '_pyautolib.so', 'linux32': '_pyautolib.so',
def Run(self): self._ParseArgs() if not os.path.isdir(self._outdir): os.makedirs(self._outdir)
urllib.urlretrieve(download_url, BUILD_ZIP_NAME)
urllib.urlretrieve(download_url, BUILD_ZIP_NAME, _Reporthook) print
def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. downl...
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...
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...
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...
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)
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)
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...
" %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...
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" return 0
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")
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self): """overridden from Argument.""" return 1
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
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_...
def GetNumInvalidValues(self):
def GetNumInvalidValues(self, func):
def GetNumInvalidValues(self): """Overridden from Argument.""" return 2
release_patch_url = "%s/release-patch/%s" % (self.url, queue_name)
release_patch_url = "%s/release-patch" % (self.url)
def _post_release_work_item(self, queue_name, patch): release_patch_url = "%s/release-patch/%s" % (self.url, queue_name) self._browser.open(release_patch_url) self._browser.select_form(name="release_patch") self._browser["queue_name"] = queue_name self._browser["attachment_id"] = unicode(patch.id()) self._browser.submi...
module_dir = os.path.join(self._source_dir, module) self._data_dirs = [path_utils.ScriptDir()] if module == "chrome": self._data_dirs.append(os.path.join(module_dir, "test", "data", "valgrind")) else: self._data_dirs.append(os.path.join(module_dir, "data", "valgrind"))
def _DefaultCommand(self, tool, module, exe=None, valgrind_test_args=None): '''Generates the default command array that most tests will use.''' module_dir = os.path.join(self._source_dir, module)
for directory in self._data_dirs: tool_name = tool.ToolName(); suppression_file = os.path.join(directory, "%s/suppressions.txt" % tool_name) if os.path.exists(suppression_file): cmd.append("--suppressions=%s" % suppression_file) for suppression_platform in common.PlatformNames(): suppression_file_platform = \ os.path....
script_dir = path_utils.ScriptDir() tool_name = tool.ToolName(); suppression_file = os.path.join(script_dir, tool_name, "suppressions.txt") if os.path.exists(suppression_file): cmd.append("--suppressions=%s" % suppression_file) for platform in common.PlatformNames(): platform_suppression_file = \ os.path.join(script_d...
def _DefaultCommand(self, tool, module, exe=None, valgrind_test_args=None): '''Generates the default command array that most tests will use.''' module_dir = os.path.join(self._source_dir, module)
for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%s.txt" % \ tool.ToolName())] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(directory, name + ".gtest_%s.txt" % platform_suffix), os.path.jo...
gtest_files_dir = os.path.join(path_utils.ScriptDir(), "gtest_exclude") gtest_filter_files = [ os.path.join(gtest_files_dir, name + ".gtest.txt"), os.path.join(gtest_files_dir, name + ".gtest-%s.txt" % tool.ToolName())] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(gtest_files_dir...
def _ReadGtestFilterFile(self, tool, 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 + ".g...
proxy = xmlrpclib.ServerProxy("http://%s/xmlrpc" % self.buildbot_host)
proxy = xmlrpclib.ServerProxy("http://%s/xmlrpc" % self.buildbot_host, allow_none=True)
def _fetch_xmlrpc_build_dictionary(self, builder, build_number): # The buildbot XMLRPC API is super-limited. # For one, you cannot fetch info on builds which are incomplete. proxy = xmlrpclib.ServerProxy("http://%s/xmlrpc" % self.buildbot_host) try: return proxy.getBuild(builder.name(), int(build_number)) except xmlrpc...
log("Error fetching data for %s build %s (%s)" % (builder.name(), build_number, build_url))
log("Error fetching data for %s build %s (%s): %s" % (builder.name(), build_number, build_url, err))
def _fetch_xmlrpc_build_dictionary(self, builder, build_number): # The buildbot XMLRPC API is super-limited. # For one, you cannot fetch info on builds which are incomplete. proxy = xmlrpclib.ServerProxy("http://%s/xmlrpc" % self.buildbot_host) try: return proxy.getBuild(builder.name(), int(build_number)) except xmlrpc...
def _compat_shim_option(option_name, nargs=0): return optparse.make_option(option_name, action="callback", callback=_compat_shim_callback, nargs=nargs, help="Ignored, for old-run-webkit-tests compat only.")
def _compat_shim_option(option_name, **kwargs): return optparse.make_option(option_name, action="callback", callback=_compat_shim_callback, help="Ignored, for old-run-webkit-tests compat only.", **kwargs)
def _compat_shim_option(option_name, nargs=0): return optparse.make_option(option_name, action="callback", callback=_compat_shim_callback, nargs=nargs, help="Ignored, for old-run-webkit-tests compat only.")
_compat_shim_option("--exit-after-n-failures", nargs=1),
_compat_shim_option("--exit-after-n-failures", nargs=1, type="int"),
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...
with codecs.open(file_path, "w", encoding) as file:
if not encoding: with open(file_path, "wb") as file: file.write(contents) return with codecs.open(file_path, "w", encoding=encoding) as file:
def _write_into_file_at_path(self, file_path, contents, encoding=None): """Writes contents at file_path, using encoding.""" with codecs.open(file_path, "w", encoding) as file: file.write(contents)
def _ClickTranslateUntilSuccess(self):
def _ClickTranslateUntilSuccess(self, window_index=0, tab_index=0):
def _ClickTranslateUntilSuccess(self): """Since the translate can fail due to server error, continue trying until it is successful or until it has tried too many times.""" max_tries = 10 curr_try = 0 while curr_try < max_tries and not self.ClickTranslateBarTranslate(): curr_try = curr_try + 1 if curr_try == 10: self.fa...
while curr_try < max_tries and not self.ClickTranslateBarTranslate():
while (curr_try < max_tries and not self.ClickTranslateBarTranslate(window_index=window_index, tab_index=tab_index)):
def _ClickTranslateUntilSuccess(self): """Since the translate can fail due to server error, continue trying until it is successful or until it has tried too many times.""" max_tries = 10 curr_try = 0 while curr_try < max_tries and not self.ClickTranslateBarTranslate(): curr_try = curr_try + 1 if curr_try == 10: self.fa...
if curr_try == 10:
if curr_try == max_tries:
def _ClickTranslateUntilSuccess(self): """Since the translate can fail due to server error, continue trying until it is successful or until it has tried too many times.""" max_tries = 10 curr_try = 0 while curr_try < max_tries and not self.ClickTranslateBarTranslate(): curr_try = curr_try + 1 if curr_try == 10: self.fa...
self._NavigateAndWaitForBar(self._GetDefaultSpanishURL()) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_translate') self._ClickTranslateUntilSuccess()
self.NavigateToURL("http://www.news.google.com") self.AppendTab(pyauto.GURL("http://www.google.com/webhp?hl=es")) self.WaitForInfobarCount(1, tab_index=1) translate_info = self.GetTranslateInfo(tab_index=1) self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_translate', tab_inde...
def testSessionRestore(self): """Test that session restore restores the translate infobar and other translate settings. """ self._NavigateAndWaitForBar(self._GetDefaultSpanishURL()) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_tran...
self.WaitForInfobarCount(1) translate_info = self.GetTranslateInfo()
self.WaitForInfobarCount(1, tab_index=1) self.WaitUntilTranslateComplete() translate_info = self.GetTranslateInfo(tab_index=1)
def testSessionRestore(self): """Test that session restore restores the translate infobar and other translate settings. """ self._NavigateAndWaitForBar(self._GetDefaultSpanishURL()) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_tran...
self.KillHandler,
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...
def KillHandler(self): """This request handler kills the server, for use when we're done" with the a particular test.""" if (self.path.find("kill") < 0): return False self.send_response(200) self.send_header('Content-type', 'text/html') self.send_header('Cache-Control', 'max-age=0') self.end_headers() if options.neve...
def KillHandler(self): """This request handler kills the server, for use when we're done" with the a particular test."""
def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0)
def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0)
pyftpdlib.ftpserver.logline = line_logger
def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0)
option_parser.add_option('', '--never-die', default=False, action="store_true", help='Prevent the server from dying when visiting ' 'a /kill URL. Useful for manually running some ' 'tests.')
def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0)
common_failures = common_failures.intersection(failures) if not common_failures: break
else: common_failures = common_failures.intersection(failures) if not common_failures: break
def find_regression_window(self, red_build, look_back_limit=30): if not red_build or red_build.is_green(): return RegressionWindow(None, None) common_failures = None current_build = red_build build_after_current_build = None look_back_count = 0 while current_build: if current_build.is_green(): # current_build can't pos...
("WebKitExamplePlugins", []),
("Examples", []),
def _should_file_trigger_build(target_platform, file): # The directories and patterns lists below map directory names or # regexp patterns to the bot platforms for which they should trigger a # build. Mapping to the empty list means that no builds should be # triggered on any platforms. Earlier directories/patterns tak...
self._old_path = None if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ: self._old_path = os.environ['DYLD_FALLBACK_LIBRARY_PATH'] os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = os.path.join( self.DataDir(), 'firefox3_nss_mac')
def setUp(self): self._to_import = ['ALL']
if self.IsMac(): if self._old_path: os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = self._old_path else: os.environ.pop('DYLD_FALLBACK_LIBRARY_PATH')
def tearDown(self): pyauto.PyUITest.tearDown(self) # Re-set the path to its state before the test. if self.IsMac(): if self._old_path: os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = self._old_path else: os.environ.pop('DYLD_FALLBACK_LIBRARY_PATH') # Delete any replacers to restore the original profiles. if self._safari_rep...
fp = codecs.open(output_log, "utf-8") try:
if self._process.returncode == None: Executive().kill_process(self._process.pid) with codecs.open(output_log, "r", "utf-8") as fp:
def start(self): if not self._web_socket_tests: _log.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
finally: fp.close()
def start(self): if not self._web_socket_tests: _log.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
self.directory = directory or "./autoinstall.cache.d/"
if directory is None: containing_directory = os.path.dirname(__file__) directory = os.path.join(containing_directory, "autoinstall.cache.d"); self.directory = directory
def __init__(self, directory=None): self.directory = directory or "./autoinstall.cache.d/" try: if not os.path.exists(self.directory): _logger.debug("Creating cache directory '%s'." % self.directory) os.mkdir(self.directory) except Exception, err: _logger.exception(err) self.cache_directry = tempfile.mkdtemp() _logger....
_logger.debug("Creating cache directory '%s'." % self.directory) os.mkdir(self.directory)
self._create_cache_directory()
def __init__(self, directory=None): self.directory = directory or "./autoinstall.cache.d/" try: if not os.path.exists(self.directory): _logger.debug("Creating cache directory '%s'." % self.directory) os.mkdir(self.directory) except Exception, err: _logger.exception(err) self.cache_directry = tempfile.mkdtemp() _logger....
reply.parent_id_string = server_entry.parent_id_string
def HandleCommit(self, commit_message, commit_response): """Respond to a Commit request by updating the user's account state.
self._sleep("Exception while preparing queue: %s." % e)
self._sleep("Exception while preparing queue")
def run(self): self._begin_logging()
if sys.platform == 'cygwin': return( 'ERROR: you are running from cygwin python, which is not\n' ' supported by "run_webkit_test.py". You should use python\n' ' for Windows (2.5+) to launch this script. A python for\n' ' Windows can be found at your depot_tools folder:\n' ' [DEPOT_TOOLS_PATH]/py...
def main(): if sys.platform == 'cygwin': return( 'ERROR: you are running from cygwin python, which is not\n' ' supported by "run_webkit_test.py". You should use python\n' ' for Windows (2.5+) to launch this script. A python for\n' ' Windows can be found at your depot_tools folder:\n' ' [DEPOT_TO...
os.path.dirname(os.path.abspath(sys.argv[0]))))))
os.path.dirname(src_dir)))))
def main(): if sys.platform == 'cygwin': return( 'ERROR: you are running from cygwin python, which is not\n' ' supported by "run_webkit_test.py". You should use python\n' ' for Windows (2.5+) to launch this script. A python for\n' ' Windows can be found at your depot_tools folder:\n' ' [DEPOT_TO...
output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
if webgl_mode: output_file.write(" '../o3d_assets/samples/%s.fake_webgl_input.txt',\n" % asset['path']) else: output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
def write_action(asset, webgl_mode): filename = posixpath.splitext(posixpath.basename(asset['path']))[0] filename = filename.replace('.','_') filename = filename.replace('-','_') filename = filename.lower() name = "convert_" + filename if webgl_mode: name = name + "_webgl" output = asset['path'].replace('convert_', '')...
write_action(asset, False);
write_action(asset, False)
def write_action(asset, webgl_mode): filename = posixpath.splitext(posixpath.basename(asset['path']))[0] filename = filename.replace('.','_') filename = filename.replace('-','_') filename = filename.lower() name = "convert_" + filename if webgl_mode: name = name + "_webgl" output = asset['path'].replace('convert_', '')...
write_action(asset, True); output_file.write(" ],\n")
write_action(asset, True) output_file.write(""" ], }, { 'target_name': 'copy_samples', 'type': 'none', 'dependencies': [ 'convert_samples', ], 'copies': [\n""")
def write_action(asset, webgl_mode): filename = posixpath.splitext(posixpath.basename(asset['path']))[0] filename = filename.replace('.','_') filename = filename.replace('-','_') filename = filename.lower() name = "convert_" + filename if webgl_mode: name = name + "_webgl" output = asset['path'].replace('convert_', '')...
output_file.write(" 'copies': [\n")
def write_action(asset, webgl_mode): filename = posixpath.splitext(posixpath.basename(asset['path']))[0] filename = filename.replace('.','_') filename = filename.replace('-','_') filename = filename.lower() name = "convert_" + filename if webgl_mode: name = name + "_webgl" output = asset['path'].replace('convert_', '')...
extractor = OrderedJSFilesExtractor(argv[1])
input_order_file_name = argv[1] extractor = OrderedJSFilesExtractor(input_order_file_name)
def main(argv): if len(argv) < 3: print('usage: %s order.html input_source_dir_1 input_source_dir_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() extractor = OrderedJSFilesExtractor(argv[1]) expander = PathExpander(argv[2:]) output = StringIO() for input_file_name in extractor.ordered_js_file...
(input_file_name, input_file_name))
(input_file_name, input_order_file_name))
def main(argv): if len(argv) < 3: print('usage: %s order.html input_source_dir_1 input_source_dir_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() extractor = OrderedJSFilesExtractor(argv[1]) expander = PathExpander(argv[2:]) output = StringIO() for input_file_name in extractor.ordered_js_file...
file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
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")
if func.can_auto_generate and (impl_func == None or impl_func == True):
impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)):
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...
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOri...
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func...
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])) code = """ typedef %(func_name)s::Result Result;
impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: 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])) code = """ ...
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])) cod...
return list(itertools.chain.from_iterable(test_batches))
return list(itertools.chain(*test_batches))
def create_driver(self, image_path, options): return RecordingTestDriver(self, image_path, options)
start = time.time()
global AnalyzeStartTime if AnalyzeStartTime == None: AnalyzeStartTime = time.time()
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.
(firstrun or ((time.time() - start) < 180.0))):
(firstrun or ((time.time() - AnalyzeStartTime) < LOG_COMPLETION_TIMEOUT))):
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.