rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
null.close() not self._proc.poll()): | null.close() | def stop(self): if self._proc: self._proc.stdin.close() self._proc.stdout.close() if self._proc.stderr: self._proc.stderr.close() if sys.platform not in ('win32', 'cygwin'): # Closing stdin/stdout/stderr hangs sometimes on OS X, # (see restart(), above), and anyway we don't want to hang # the harness if test_shell is b... |
code = """%(return_type)s %(name)s(%(typed_args)s) { if (%(count_name)s < 0) { SetGLError(GL_INVALID_VALUE, "gl%(name)s: n < 0"); return; } %(resource_type)s_id_handler_->MakeIds(0, %(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % { | args = { | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) { |
}) | } file.Write("%(return_type)s %(name)s(%(typed_args)s) {\n" % args) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file, func) code = """ %(resource_type)s_id_handler_->MakeIds(0, %(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % args) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) { |
code = """%(return_type)s %(name)s(%(typed_args)s) { if (%(count_name)s < 0) { SetGLError(GL_INVALID_VALUE, "gl%(name)s: n < 0"); return; } %(resource_type)s_id_handler_->FreeIds(%(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % { | args = { | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: code = """%(return_type)s %(name)s(%(typed_args)s) { |
}) | } file.Write("%(return_type)s %(name)s(%(typed_args)s) {\n" % args) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file, func) code = """%(resource_type)s_id_handler_->FreeIds(%(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % args) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: code = """%(return_type)s %(name)s(%(typed_args)s) { |
if (!ComputeDataSize(1, sizeof(%s), %d, &data_size)) { | if (!ComputeDataSize(count, sizeof(%s), %d, &data_size)) { | def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" code = """ uint32 data_size; |
if assignee: | if assignee and not self.browser.find_control("assigned_to").disabled: | def create_bug(self, bug_title, bug_description, component=None, diff=None, patch_description=None, cc=None, blocked=None, assignee=None, mark_for_review=False, mark_for_commit_queue=False): self.authenticate() |
if get_len_func[0:2] == 'gl': | if get_len_func and get_len_func[0:2] == 'gl': | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ |
logging.info('Using handler_map_file: %s' % handler_map_file) | logging.debug('Using handler_map_file: %s' % handler_map_file) | def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name) |
logging.info('Starting %s server on %d.' % ( | logging.debug('Starting %s server on %d.' % ( | def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name) |
logging.info('Shutting down %s server %d.' % (self._server_name, pid)) | logging.debug('Shutting down %s server %d.' % (self._server_name, pid)) | def stop(self, force=False): if not force and not self.is_running(): return |
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... |
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... | |
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... |
return source_paths | return sorted(source_paths) | def _parse_source_files(self): """ Returns a list of paths to source files present in the extenion. |
['--print-last-failures']) | ['--platform', 'test', '--print-last-failures']) | def test_last_results(self): passing_run(['--platform', 'test', 'fast/html']) (res, buildbot_output, regular_output) = logging_run( ['--print-last-failures']) self.assertEqual(regular_output.get(), ['\n\n']) self.assertEqual(buildbot_output.get(), []) |
'.*closed.*')) | '(?i).*closed.*')) | def CheckChangeOnCommit(input_api, output_api): results = [] if not input_api.json: results.append(output_api.PresubmitNotifyResult( 'You don\'t have json nor simplejson installed.\n' ' This is a warning that you will need to upgrade your python ' 'installation.\n' ' This is no big deal but you\'ll eventually need to... |
index = test.find(self.WEBKIT_PATH) | index = test.find(self.LAYOUT_TESTS_PATH) | def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.WEBKIT_PATH) if index is not -1: index += len(self.WEBKIT_PATH) |
index += len(self.WEBKIT_PATH) | index += len(self.LAYOUT_TESTS_PATH) | def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.WEBKIT_PATH) if index is not -1: index += len(self.WEBKIT_PATH) |
logging.error("results.json was not valid JSON. Clobbering.") | logging.debug("results.json was not valid JSON. Clobbering.") | def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test) |
logging.error("Builder name (%s) is not in the results.json file." % | logging.debug("Builder name (%s) is not in the results.json file." % | def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test) |
if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == 1 and self.TESTS in results_json): LAYOUTTESTS_PREFIX = 'LayoutTests/' test_results = results_json[self.TESTS] for test in test_results.keys(): if test.startswith(LAYOUTTESTS_PREFIX): new_test = test[len(LAYOUTTESTS_PREFIX):] test_results[new_t... | if results_json[self.VERSION_KEY] == 2: for results_for_builder in results_json.itervalues(): try: test_results = results_for_builder[self.TESTS] except: continue for test in test_results: test_path = self._GetPathRelativeToLayoutTestRoot(test) if test_path != test: test_results[test_path] = test_results[test] del te... | def _ConvertJSONToCurrentVersion(self, results_json): """If the JSON does not match the current version, converts it to the current version and adds in the new version number. """ if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == self.VERSION): return |
os.path.join(chrome_src, 'chrome', 'Release')], | os.path.join(chrome_src, 'build', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release'), os.path.join(chrome_src, 'build', 'Release')], | def _LocateBinDirs(): """Setup a few dirs where we expect to find dependency libraries.""" script_dir = os.path.dirname(__file__) chrome_src = os.path.join(script_dir, os.pardir, os.pardir, os.pardir) bin_dirs = { 'linux2': [ os.path.join(chrome_src, 'out', 'Debug'), os.path.join(chrome_src, 'sconsbuild', 'Debug'), os... |
return self.GetPrefsInfo().Prefs(pyauto.kDesktopNotificationDeniedOrigins) | return (self.GetPrefsInfo().Prefs(pyauto.kDesktopNotificationDeniedOrigins) or []) | def _GetDeniedOrigins(self): """Gets the list of origins that are explicitly denied to create notifications. """ return self.GetPrefsInfo().Prefs(pyauto.kDesktopNotificationDeniedOrigins) |
return self.GetPrefsInfo().Prefs(pyauto.kDesktopNotificationAllowedOrigins) | return (self.GetPrefsInfo().Prefs(pyauto.kDesktopNotificationAllowedOrigins) or []) | def _GetAllowedOrigins(self): """Gets the list of origins that are explicitly allowed to create notifications. """ return self.GetPrefsInfo().Prefs(pyauto.kDesktopNotificationAllowedOrigins) |
denied = self._GetDeniedOrigins() or [] | denied = self._GetDeniedOrigins() | def _DenyOrigin(self, new_origin): """Denies the given origin to create notifications. |
allowed = self._GetAllowedOrigins() or [] | allowed = self._GetAllowedOrigins() | def _AllowOrigin(self, new_origin): """Allows the given origin to create notifications. If it was explicitly denied, that preference is dropped. """ self._DropOriginPreference(new_origin) allowed = self._GetAllowedOrigins() or [] if new_origin not in allowed: self._SetAllowedOrigins(allowed + [new_origin]) |
self.CallJavascriptFunc('requestPermission', [], windex, tab_index) | self.CallJavascriptFunc('requestPermission', [], tab_index, windex) | def _RequestPermission(self, tab_index=0, windex=0): """Requests permission to create notifications. |
self.PerformActionOnInfobar('accept', infobar_index=0) | self.PerformActionOnInfobar('accept', 0) | def testAllowOnPermissionInfobar(self): """Tries to create a notification and clicks allow on the infobar.""" self.NavigateToURL(self.TEST_PAGE_URL) # This notification should not be shown because we do not have permission. self._CreateHTMLNotification(self.NO_SUCH_URL) self.assertFalse(self.GetActiveNotifications()) |
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... |
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... | |
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... |
def _wdiff_command(self): | def _wdiff_command(self, actual_filename, expected_filename): | def _wdiff_command(self): executable = self._path_to_wdiff() return [executable, "--start-delete=%s" % self._WDIFF_DEL, "--end-delete=%s" % self._WDIFF_END, "--start-insert=%s" % self._WDIFF_ADD, "--end-insert=%s" % self._WDIFF_END, actual_filename, expected_filename] |
return self._executive.run_command(self._wdiff_command()) | cmd = self._wdiff_command(actual_filename, expected_filename) return self._executive.run_command(cmd) | def wdiff_text(self, actual_filename, expected_filename): """Returns a string of HTML indicating the word-level diff of the contents of the two filenames. Returns an empty string if word-level diffing isn't available.""" |
result = check_file_exists(helper_path, 'layout test helper') and result | if helper_path: result = check_file_exists(helper_path, 'layout test helper') and result | def check_build(self, needs_http): result = True test_shell_binary_path = self._path_to_driver() result = check_file_exists(test_shell_binary_path, 'test driver') if result: result = (self._check_driver_build_up_to_date(self._options.target) and result) else: logging.error('') |
help=('The directory that stores the results for' ' rebaselining comparison.')) | help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('', '--use_drt', action='store_true', default=False, help=('Use ImageDiff from DumpRenderTree instead ' 'of image_diff for pixel tests.')) | 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('-q', '--quiet', action='store_true', help='Suppress result HTML viewing') op... |
return self._child_process.stdout.readline().rstrip() | windows_path = self._child_process.stdout.readline().rstrip() windows_path = '%s%s' % (windows_path[0].upper(), windows_path[1:]) return windows_path | def convert(self, path): if not self.is_running(): self.start() self._child_process.stdin.write("%s\r\n" % path) self._child_process.stdin.flush() return self._child_process.stdout.readline().rstrip() |
if dir in DEPENDENT_DIRS: return [output_api.PresubmitPromptWarning(REBUILD_WARNING)] | while len(dir): if dir in BLACKLIST_DIRS: return [] if dir in DEPENDENT_DIRS: return [output_api.PresubmitPromptWarning(REBUILD_WARNING)] dir = os.path.dirname(dir) | def CheckChange(input_api, output_api): for f in input_api.AffectedFiles(): dir = os.path.normpath(input_api.os_path.dirname(f.LocalPath())) if dir in DEPENDENT_DIRS: return [output_api.PresubmitPromptWarning(REBUILD_WARNING)] return [] |
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... |
Committer("Yong Li", ["yong.li@torchmobile.com", "yong.li.webkit@gmail.com"], "yong"), | Committer("Yong Li", ["yong.li.webkit@gmail.com", "yong.li@torchmobile.com"], "yong"), | def __init__(self, name, email_or_emails, irc_nickname=None): Committer.__init__(self, name, email_or_emails, irc_nickname) self.can_review = True |
retcode = self.Run(cmdlist) | retcode = self.Run(cmdlist, ignore_retcode=True) | def RunTests(self): """Run all unit tests and generate appropriate lcov files.""" self.BeforeRunAllTests() for fulltest in self.tests: if not os.path.exists(fulltest): logging.info(fulltest + ' does not exist') if self.options.strict: sys.exit(2) else: logging.info('%s path exists' % fulltest) cmdlist = [fulltest, '--g... |
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. |
cmd += ['arch', '-i386', port._path_to_driver(), '-'] | cmd += [port._path_to_driver(), '-'] | def __init__(self, port, image_path, driver_options): self._port = port self._driver_options = driver_options self._image_path = image_path |
path_utils.PlatformName(), options.target == 'Debug') | path_utils.PlatformName(), self._options.target == 'Debug') | def PrepareListsAndPrintOutput(self, write): """Create appropriate subsets of test lists and returns a ResultSummary object. Also prints expected test counts. |
script_directory = os.path.abspath(__file__) | script_directory = os.path.dirname(os.path.abspath(__file__)) | def default_scm(): """Return the default SCM object as determined by the CWD and running code. Returns the default SCM object for the current working directory; if the CWD is not in a checkout, then we attempt to figure out if the SCM module itself is part of a checkout, and return that one. If neither is part of a ch... |
'WebKit::DrawingAreaBase::DrawingAreaInfo': '"DrawingAreaInfo.h"' | def headers_for_type(type): # Check for Vector. match = re.search(r'Vector<(.+)>', type) if match: element_type = match.groups()[0].strip() return ['<wtf/Vector.h>'] + headers_for_type(element_type) special_cases = { 'WTF::String': '<wtf/text/WTFString.h>', 'WebCore::KeypressCommand': '<WebCore/KeyboardEvent.h>', 'Web... | |
if 'CHROME_ORIGIN' not in os.environ.keys() or \ (os.environ['CHROME_ORIGIN'] != 'LOCAL_SOURCE' and os.environ['CHROME_ORIGIN'] != 'SERVER_SOURCE'): logging.info('Skipping Chrome test resource setup for non-local builds') return chrome_test_files = os.environ['SYSROOT'] + '/usr/local/autotest-chrome' logging.info('Con... | return | def setup(top_dir): if 'CHROME_ORIGIN' not in os.environ.keys() or \ (os.environ['CHROME_ORIGIN'] != 'LOCAL_SOURCE' and os.environ['CHROME_ORIGIN'] != 'SERVER_SOURCE'): logging.info('Skipping Chrome test resource setup for non-local builds') return chrome_test_files = os.environ['SYSROOT'] + '/usr/local/autotest-chrom... |
utils.update_version(pwd + '/src', False, version, setup, pwd) | utils.update_version(pwd + '/src', False, version, setup, None) | def setup(top_dir): if 'CHROME_ORIGIN' not in os.environ.keys() or \ (os.environ['CHROME_ORIGIN'] != 'LOCAL_SOURCE' and os.environ['CHROME_ORIGIN'] != 'SERVER_SOURCE'): logging.info('Skipping Chrome test resource setup for non-local builds') return chrome_test_files = os.environ['SYSROOT'] + '/usr/local/autotest-chrom... |
server_data = { 'port': listen_port } server_data_json = simplejson.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('@H', server_data['port'])) | 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... |
" .WillOnce(SetArgumentPointee<2>(strlen(kInfo)));") % ( | " .WillOnce(SetArgumentPointee<2>(strlen(kInfo) + 1));") % ( | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ |
result = self._CreateImageDiff(filename, target) | def CompareOutput(self, filename, proc, output, test_args, target): """Implementation of CompareOutput that checks the output image and checksum against the expected files from the LayoutTest directory. """ failures = [] | |
self._platform = platform self._options = options self._rebaselining_tests = [] self._rebaselined_tests = [] self._test_expectations = \ test_expectations.TestExpectations(None, self._file_dir, platform, False, False) self._repo_type = self._get_repo_type() def run(self, backup): """Run rebaseline process.""" l... | self._result_queue = Queue.Queue() self._current_dir = None self._current_progress_str = "" self._current_test_number = 0 def __del__(self): logging.debug("flushing stdout") sys.stdout.flush() logging.debug("flushing stderr") sys.stderr.flush() logging.debug("stopping http server") self._http_server.stop() self._... | def __init__(self, platform, options): self._file_dir = path_utils.path_from_base('webkit', 'tools', 'layout_tests') self._platform = platform self._options = options self._rebaselining_tests = [] self._rebaselined_tests = [] |
log_dashed_string('Extracting and adding new baselines', self._platform) if not self._extract_and_add_new_baselines(archive_file): return False log_dashed_string('Updating rebaselined tests in file', self._platform) self._update_rebaselined_tests_in_file(backup) logging.info('') if len(self._rebaselining_tests) != le... | out_filename = os.path.join(self._options.results_directory, "results.html") out_file = open(out_filename, 'w') if self._options.full_results_html: h2 = "Test Failures" else: h2 = "Unexpected Test Failures" out_file.write("<html><head><title>Layout Test Results (%(time)s)" "</title></head><body><h2>%(h2)s (%(time)s)</... | def run(self, backup): """Run rebaseline process.""" |
def get_rebaselining_tests(self): return self._rebaselining_tests def _get_repo_type(self): """Get the repository type that client is using.""" output, return_code = run_shell_with_return_code(['svn', 'info'], False) if return_code == 0: return REPO_SVN return REPO_UNKNOWN def _compile_rebaselining_tests(self): """C... | def _show_results_html_file(self): """Launches the test shell open to the results.html page.""" results_filename = os.path.join(self._options.results_directory, "results.html") subprocess.Popen([path_utils.test_shell_path(self._options.target), path_utils.filename_to_uri(results_filename)]) def _add_to_dict_of_lists(... | def get_rebaselining_tests(self): return self._rebaselining_tests |
logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be ' 'specified in order to rebaseline.') | logging.basicConfig(level=log_level, format=log_fmt, datefmt=log_datefmt, stream=meter) if not options.target: if options.debug: options.target = "Debug" else: options.target = "Release" if not options.use_apache: options.use_apache = sys.platform in ('darwin', 'linux2') if options.results_directory.startswith("/"):... | 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... |
platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_p... | write = create_logging_writer(options, "config") write("Using platform '%s'" % options.platform) write("Placing test results in %s" % options.results_directory) if options.new_baseline: write("Placing new baselines in %s" % path_utils.chromium_baseline_path(options.platform)) write("Using %s build at %s" % (options.tar... | 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... |
main() | options, args = parse_args() main(options, args) | 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... |
return self._parse_bug_page(self._fetch_bug_page(bug_id)) | try: return self._parse_bug_page(self._fetch_bug_page(bug_id)) except: self.authenticate() return self._parse_bug_page(self._fetch_bug_page(bug_id)) | def fetch_bug_dictionary(self, bug_id): return self._parse_bug_page(self._fetch_bug_page(bug_id)) |
if executive.run_command([self.script_path("build-dumprendertree")], | build_drt_command = [self.script_path("build-dumprendertree")] if self._options.target == "Debug": build_drt_command.append('--debug') if executive.run_command(build_drt_command, | def check_build(self, needs_http): if executive.run_command([self.script_path("build-dumprendertree")], return_exit_code=True): return False |
try: os.kill(current_pid, 0) except OSError: return False else: return True | if sys.platform in ('darwin', 'linux2'): try: os.kill(current_pid, 0) except OSError: return False return True | def _check_pid(self, current_pid): """Return True if pid is alive, otherwise return False.""" try: os.kill(current_pid, 0) except OSError: return False else: return True |
if not (current_pid and sys.platform in ('darwin', 'linux2') and self._check_pid(int(current_pid))): | if not (current_pid and self._check_pid(int(current_pid))): | def _curent_lock_pid(self): """Return with the current lock pid. If the lock is not valid it deletes the lock file.""" lock_list = self._lock_file_list() if not lock_list: return try: current_lock_file = open(lock_list[0], 'r') current_pid = current_lock_file.readline() current_lock_file.close() if not (current_pid and... |
sequential_guard_lock = os.open(self._guard_lock_file, os.O_CREAT | os.O_NONBLOCK | os.O_EXCL) | sequential_guard_lock = os.open(self._guard_lock_file, os.O_CREAT | os.O_EXCL) | def _create_lock_file(self): """The lock files are used to schedule the running test sessions in first come first served order. The sequential guard lock ensures that the lock numbers are sequential.""" while(True): try: sequential_guard_lock = os.open(self._guard_lock_file, os.O_CREAT | os.O_NONBLOCK | os.O_EXCL) |
patch_id = 'synthetic-' + synthetic_patch_id_counter | patch_id = 'synthetic-%d' % synthetic_patch_id_counter | def get(self, queue_name): work_items = WorkItems.all().filter("queue_name =", queue_name).get() statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue_name).order("-date").fetch(15) |
input_api, output_api, sources)) | input_api, output_api, source_file_filter=sources)) | def _CommonChecks(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 InputApi.... |
input_api, output_api, text_files)) | input_api, output_api, source_file_filter=text_files)) | def _CommonChecks(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 InputApi.... |
input_api, output_api, _LICENSE_HEADER, sources)) | input_api, output_api, _LICENSE_HEADER, source_file_filter=sources)) | def _CommonChecks(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 InputApi.... |
print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' | logging.info('coverage_posix.py: doing a "cd .." ' 'to accomodate Linux/make PWD') | def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to b... |
print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' | logging.info('coverage_posix.py: doing a "cd src" ' 'to accomodate buildbot PWD') | def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to b... |
reports = map(lambda(x): map(str, x), a) | reports = map(lambda(x): map(str, x), reports) | def GetReports(self, files): '''Extracts reports from a set of files. |
'third_party', 'WebKit', 'WebKitTools', 'Scripts', 'webkitpy', 'thirdparty', 'pywebsocket') | 'third_party', 'WebKit', 'WebKitTools', 'pywebsocket') | def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name) |
'third_party', 'WebKit', 'WebKitTools', 'Scripts', 'webkitpy', 'thirdparty', 'pywebsocket', 'mod_pywebsocket', 'standalone.py') | 'third_party', 'WebKit', 'WebKitTools', 'pywebsocket', 'mod_pywebsocket', 'standalone.py') | def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name) |
return len(run_command(['git', 'rev-list', '--max-count=1', self.svn_branch_name(), '^head'])) | return len(run_command(['git', 'rev-list', '--max-count=1', self.svn_branch_name(), '^HEAD'])) | def _svn_branch_has_extra_commits(self): return len(run_command(['git', 'rev-list', '--max-count=1', self.svn_branch_name(), '^head'])) |
test_prefixes = ["FLAKY", "FAILS"] | test_prefixes = ["FLAKY", "FAILS", "MAYBE"] | 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-%... |
(self._test_results_server, self._builder_name, | (urllib2.quote(self._test_results_server), urllib2.quote(self._builder_name), | def _get_archived_json_results(self, for_incremental=False): """Reads old results JSON file if it exists. Returns (archived_results, error) tuple where error is None if results were successfully read. |
url='http://foo/?q=%s') | url='http://localhost/?q=%s') | def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://foo/?q=foobar', self.GetActiveTabURL().spec()) |
self.assertEqual('http://foo/?q=foobar', self.GetActiveTabURL().spec()) | self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec()) | def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://foo/?q=foobar', self.GetActiveTabURL().spec()) |
new_url='http://foo/?bar=true&q=%s') | new_url='http://localhost/?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://foo/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineWithKey... |
self.assertEqual('http://foo/?bar=true&q=foobar', | self.assertEqual('http://localhost/?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://foo/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineWithKey... |
url='http://foo/?q=%s') | url='http://localhost/?q=%s') | def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://foo/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.com') f... |
self.assertEqual('http://foo/?q=foobar', | self.assertEqual('http://localhost/?q=foobar', | def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://foo/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.com') f... |
startup_pipe.write(struct.pack('@H', listen_port)) | startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(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... |
show_in_main_help = True | def _prepare_state(self, options, args, tool): state = {} state["bug_id"] = self._bug_id(options, args, tool, state) if not state["bug_id"]: error("No bug id passed and no bug url found in ChangeLogs.") return state | |
cmd = [executable, '--diff', expected_filename, actual_filename] | def diff_image(self, expected_filename, actual_filename, diff_filename=None): """Compare two image files and produce a delta image file. | |
cmd.append(diff_filename) | cmd = [executable, '--diff', expected_filename, actual_filename, diff_filename] else: cmd = [executable, expected_filename, actual_filename] | def diff_image(self, expected_filename, actual_filename, diff_filename=None): """Compare two image files and produce a delta image file. |
return None | overrides_file = self.path_from_chromium_base('webkit', 'tools', 'layout_tests', 'test_expectations.txt') if os.path.exists(overrides_file): return file(overrides_file, "r").read() else: return None | def test_expectations_overrides(self): # FIXME: uncomment this when we're convinced the upstream code # is working. #overrides_file = self.path_from_chromium_base('webkit', 'tools', # 'layout_tests', 'test_expectations.txt') #if os.path.exists(overrides_file): # return file(overrides_file, "r").read() #else: # ... |
passing_run(['--platform', 'dryrun', 'fast/html']) | passing_run(['--platform', 'test', 'fast/html']) | def test_last_results(self): passing_run(['--platform', 'dryrun', 'fast/html']) (res, buildbot_output, regular_output) = logging_run( ['--print-last-failures']) self.assertEqual(regular_output.get(), ['\n']) self.assertEqual(buildbot_output.get(), []) |
self.assertEqual(regular_output.get(), ['\n']) | self.assertEqual(regular_output.get(), ['\n\n']) | def test_last_results(self): passing_run(['--platform', 'dryrun', 'fast/html']) (res, buildbot_output, regular_output) = logging_run( ['--print-last-failures']) self.assertEqual(regular_output.get(), ['\n']) self.assertEqual(buildbot_output.get(), []) |
crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx') | crx_file = os.path.abspath( os.path.join(self.DataDir(), 'extensions', 'theme.crx')) | def testSetTheme(self): """Verify theme install.""" self.assertFalse(self.GetThemeInfo()) # Verify there's no theme at startup crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx') self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file))) theme = self.GetThemeInfo() self.assertEqual('camo theme', theme['n... |
crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx') | crx_file = os.path.abspath( os.path.join(self.DataDir(), 'extensions', 'theme.crx')) | def testThemeReset(self): """Verify theme reset.""" crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx') self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file))) self.assertTrue(self.ResetToDefaultTheme()) self.assertFalse(self.GetThemeInfo()) |
self.stanzas.append(stanza.toxml()) def testBasic(self): parser = xmppserver.StanzaParser(self) parser.FeedString('<foo') self.assertEqual(len(self.stanzas), 0) parser.FeedString('/><bar></bar>') self.assertEqual(self.stanzas[0], '<foo/>') self.assertEqual(self.stanzas[1], '<bar/>') def testStream(self): parser = xmp... | def ExpectStanza(stanza, name): if stanza.tagName != name: raise UnexpectedXml(stanza) def ExpectIq(stanza, type, name): ExpectStanza(stanza, 'iq') if (stanza.getAttribute('type') != type or stanza.firstChild.tagName != name): raise UnexpectedXml(stanza) def GetStanzaId(stanza): return stanza.getAttribute('id') def ... | def FeedStanza(self, stanza): # We can't append stanza directly because it is unlinked after # this callback. self.stanzas.append(stanza.toxml()) |
self.jid = jid def DoHandshake(self, resource_prefix, resource, username, initial_stream_domain, auth_domain, auth_stream_domain): self.data_received = 0 id_generator = xmppserver.IdGenerator('foo') handshake_task = ( xmppserver.HandshakeTask(self, id_generator, resource_prefix)) stream_xml = xmppserver.ParseXml('<str... | self._jid = jid self._handshake_task = None self._connections.add(self) print "Handshake done for %s" % self def _HandleIq(self, iq): if (iq.firstChild and iq.firstChild.namespaceURI == 'google:notifier'): iq_id = iq.getAttribute('id') self._HandleNotifierCommand(iq_id, iq.firstChild) elif iq.getAttribute('type') == '... | def HandshakeDone(self, jid): self.jid = jid |
username_domain = username auth_string = base64.b64encode('\0%s\0bar' % username_domain) auth_xml = xmppserver.ParseXml('<auth>%s</auth>'% auth_string) handshake_task.FeedStanza(auth_xml) self.assertEqual(self.data_received, 3) stream_xml = xmppserver.ParseXml('<stream:stream xmlns:stream="foo"/>') stream_xml.setAttri... | raise UnexpectedXml(iq) def _HandleNotifierCommand(self, id, command_xml): command = command_xml.tagName if command == 'getAll': if not command_xml.getElementsByTagName('SubscribedServiceUrl'): raise UnexpectedXml(command_xml) self._SendNotifierStanza(id, 'result') elif command == 'set': SendNotification(self._conne... | def DoHandshake(self, resource_prefix, resource, username, initial_stream_domain, auth_domain, auth_stream_domain): self.data_received = 0 id_generator = xmppserver.IdGenerator('foo') handshake_task = ( xmppserver.HandshakeTask(self, id_generator, resource_prefix)) stream_xml = xmppserver.ParseXml('<stream:stream xmlns... |
self.assertEqual(len(socket_map), 0) xmpp_server = FakeXmppServer(socket_map, ('', 0)) self.assertEqual(len(socket_map), 1) xmpp_server.handle_accept() self.assertEqual(len(socket_map), 2) if __name__ == '__main__': unittest.main() | xmpp_server = xmppserver.XmppServer(socket_map, ('127.0.0.1', 5222)) asyncore.loop(30.0, False, socket_map) """ def __init__(self, socket_map, addr): asyncore.dispatcher.__init__(self, None, socket_map) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.set_reuse_addr() self.bind(addr) self.listen(5) self._so... | def accept(self2): return (self, ('', 0)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.