rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
gl_arg_strings.append("result->GetData()")
if func.GetInfo('gl_test_func') == 'glGetIntegerv': gl_arg_strings.append("_") else: gl_arg_strings.append("result->GetData()")
typedef %(name)s::Result Result;
overide_config_name = 'chromium.sync-branch' override_branch_name = RunGit(['config', '--get', overide_config_name])
override_branch_name = GetOverrideShortBranchName()
def GetGClientBranchName(): """Returns the name of the magic branch that lets us know that DEPS is managing the update cycle.""" # Is there an override branch specified? overide_config_name = 'chromium.sync-branch' override_branch_name = RunGit(['config', '--get', overide_config_name]) if not override_branch_name: retu...
subprocess.check_call(['git', 'fetch'], shell=(os.name == 'nt'))
subprocess.check_call(['git', 'fetch', GetRemote()], shell=(os.name == 'nt'))
def UpdateGClientBranch(webkit_rev, magic_gclient_branch): """Update the magic gclient branch to point at |webkit_rev|. Returns: true if the branch didn't need changes.""" target = FindSVNRev(webkit_rev) if not target: print "r%s not available; fetching." % webkit_rev subprocess.check_call(['git', 'fetch'], shell=(os....
license_path = os.path.join(path, filename)
if filename.startswith('/'): license_path = os.path.join(os.getcwd(), filename[1:]) else: license_path = os.path.join(path, filename)
def ParseDir(path): """Examine a third_party/foo component and extract its metadata.""" # Parse metadata fields out of README.chromium. # We examine "LICENSE" for the license file by default. metadata = { "License File": "LICENSE", # Relative path to license text. "Name": None, # Short name (for header ...
metadata["License File"] = filename
metadata["License File"] = license_path
def ParseDir(path): """Examine a third_party/foo component and extract its metadata.""" # Parse metadata fields out of README.chromium. # We examine "LICENSE" for the license file by default. metadata = { "License File": "LICENSE", # Relative path to license text. "Name": None, # Short name (for header ...
def ScanThirdPartyDirs(third_party_dirs):
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] if path in PRUNE_PATHS: dirs[:] = [] continue for skip in PRUNE_DIRS: if skip in dirs: dirs.remove(skip) if os.path.basename(path)...
def ScanThirdPartyDirs(third_party_dirs): """Scan a list of directories and report on any problems we find.""" errors = [] for path in sorted(third_party_dirs): try: metadata = ParseDir(path) except LicenseError, e: errors.append((path, e.args[0])) continue for path, error in sorted(errors): print path + ": " + error ...
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] if path in PRUNE_PATHS: dirs[:] = [] continue for skip in PRUNE_DIRS: if skip in dirs: dirs.remove(skip) if os.path.basename(path)...
return len(errors) == 0 def GenerateCredits(): """Generate about:credits, dumping the result to stdout.""" def EvaluateTemplate(template, env, escape=True): """Expand a template with variables like {{foo}} using a dictionary of expansions.""" for key, val in env.items(): if escape: val = cgi.escape(val) template = te...
def ScanThirdPartyDirs(third_party_dirs): """Scan a list of directories and report on any problems we find.""" errors = [] for path in sorted(third_party_dirs): try: metadata = ParseDir(path) except LicenseError, e: errors.append((path, e.args[0])) continue for path, error in sorted(errors): print path + ": " + error ...
third_party_dirs = FindThirdPartyDirs() ScanThirdPartyDirs(third_party_dirs)
command = 'help' if len(sys.argv) > 1: command = sys.argv[1] if command == 'scan': if not ScanThirdPartyDirs(): sys.exit(1) elif command == 'credits': if not GenerateCredits(): sys.exit(1) else: print __doc__ sys.exit(1)
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] # Pretty up the path. if path in PRUNE_PATHS: dirs[:] = [] continue # Prune out directories we want to skip. # (Note that we loop ove...
body = re.sub(r'\bgl_MultiTexCoord%d\b' % n, 'texcoord%d' % n, body) attributes.append('attribute vec4 texcoord%d;' % n)
body = re.sub(r'\bgl_MultiTexCoord%d\b' % n, 'texCoord%d' % n, body) attributes.append('attribute vec4 texCoord%d;' % n)
def fix_glsl_body(body, input_mapping): # Change uniform names back to original. for match in re.findall(r'(?m)^uniform (?:\w+) (\w+)', body): body = re.sub(r'\b%s\b' % match, input_mapping[match], body) # Change attribute names back to original. for match in re.findall(r'(?m)^attribute (?:\w+) (\w+)', body): attr_nam...
else: if start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src')
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...
hname = '%s%s.h' % (prefix, root)
if fileName != '': hname = '%s.h' % (fileName) else: hname = '%s%s.h' % (prefix, root)
def main(args): sections = SplitArgsIntoSections(args[1:]) assert len(sections) == 3, sections (base, inputs, options) = sections assert len(base) == 3, base (input, cppdir, hdir) = base assert len(inputs) > 1, inputs generateBindings = inputs[0] perlModules = inputs[1:] includeDirs = [] for perlModule in perlModule...
url='http://localhost/?q=%s')
url=self._localhost_prefix + '?q=%s')
def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://localhost/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec())
self.assertEqual('http://localhost/?q=foobar',
self.assertEqual(self._localhost_prefix + '?q=foobar',
def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://localhost/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec())
new_url='http://localhost/?bar=true&q=%s')
new_url=self._localhost_prefix + '?bar=true&q=%s')
def testEditSearchEngine(self): """Test editing a search engine's properties.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.EditSearchEngine(keyword='foo.com', new_title='bar', new_keyword='bar.com', new_url='http://localhost/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineW...
self.assertEqual('http://localhost/?bar=true&q=foobar',
self.assertEqual(self._localhost_prefix + '?bar=true&q=foobar',
def testEditSearchEngine(self): """Test editing a search engine's properties.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.EditSearchEngine(keyword='foo.com', new_title='bar', new_keyword='bar.com', new_url='http://localhost/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineW...
url='http://localhost/?q=%s')
url=self._localhost_prefix + '?q=%s')
def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://localhost/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.c...
self.assertEqual('http://localhost/?q=foobar',
self.assertEqual(self._localhost_prefix + '?q=foobar',
def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://localhost/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.c...
credit_cards = self.EvalDataFrom(file_path) self.FillAutoFillProfile(credit_cards=credit_cards) self.assertEqual(credit_cards,
test_data = self.EvalDataFrom(file_path) credit_cards_input = test_data['input'] self.FillAutoFillProfile(credit_cards=credit_cards_input) self.assertEqual(test_data['expected'],
def testFillProfileCrazyCharacters(self): """Test filling profiles with unicode strings and crazy characters.""" # Adding autofill profiles. file_path = os.path.join(self.DataDir(), 'autofill', 'crazy_autofill.txt') profiles = self.EvalDataFrom(file_path) self.FillAutoFillProfile(profiles=profiles)
credit_card = {'CREDIT_CARD_NUMBER': 'Not_Checked'}
credit_card = {'CREDIT_CARD_NUMBER': 'Not_0123-5Checked'} expected_credit_card = {'CREDIT_CARD_NUMBER': '01235'}
def testAutofillInvalid(self): """Test filling in invalid values for profiles and credit cards.""" # First try profiles with invalid input. without_invalid = {'NAME_FIRST': u'Will', 'ADDRESS_HOME_CITY': 'Sunnyvale', 'ADDRESS_HOME_STATE': 'CA', 'ADDRESS_HOME_ZIP': 'my_zip', 'ADDRESS_HOME_COUNTRY': 'USA'} # Add some inva...
self.assertEqual([credit_card], self.GetAutoFillProfile()['credit_cards'])
self.assertEqual([expected_credit_card], self.GetAutoFillProfile()['credit_cards'])
def testAutofillInvalid(self): """Test filling in invalid values for profiles and credit cards.""" # First try profiles with invalid input. without_invalid = {'NAME_FIRST': u'Will', 'ADDRESS_HOME_CITY': 'Sunnyvale', 'ADDRESS_HOME_STATE': 'CA', 'ADDRESS_HOME_ZIP': 'my_zip', 'ADDRESS_HOME_COUNTRY': 'USA'} # Add some inva...
main()
exit(main())
def main(): cmd = [sys.executable] src_dir=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname( os.path.dirname(os.path.abspath(sys.argv[0])))))) script_dir=os.path.join(src_dir, "third_party", "WebKit", "WebKitTools", "Scripts") script = os.path.join(script_dir, 'new-run-webkit-tests') cmd.append(script) if '...
html_uri = "file:///" + self._html_file
html_uri = self._target_port.filename_to_uri(self._html_file)
def show_html(self): """Launch the rebaselining html in brwoser."""
status_groups_by_patch_id = {}
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)
if status.active_patch_id: patch_id = status.active_patch_id
patch_id = status.active_patch_id if not patch_id or last_patch_id != patch_id: status_group = [] status_groups.append(status_group)
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)
patch_id = 'synthetic-%d' % synthetic_patch_id_counter synthetic_patch_id_counter += 1 if patch_id not in status_groups_by_patch_id: new_status_group = [] status_groups_by_patch_id[patch_id] = new_status_group status_groups.append(new_status_group) status_groups_by_patch_id[patch_id].append(status)
status_group = status_groups[-1] status_group.append(status) last_patch_id = patch_id
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)
samples.sort(lambda x,y: cmp(x['name'].upper(), y['name'].upper()))
def compareSamples(sample1, sample2): """ Compares two samples as a sort comparator, by name then path. """ value = cmp(sample1['name'].upper(), sample2['name'].upper()) if value == 0: value = cmp(sample1['path'], sample2['path']) return value samples.sort(compareSamples)
def _parseManifestData(self, manifest_paths, api_manifest): """ Returns metadata about the sample extensions given their manifest paths.
return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit), "--"] + changed_files, decode_output=False)
return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit), "--"] + changed_files, decode_output=False, cwd=self.checkout_root)
def create_patch(self, git_commit=None, changed_files=[]): """Returns a byte array (str()) representing the patch file. Patch files are effectively binary since they may contain files of multiple different encodings.""" # FIXME: This should probably use cwd=self.checkout_root return self.run(['git', 'diff', '--binary',...
json_file.close()
finally: json_file.close()
def parse_json_file(path, encoding="utf-8"): """ Load the specified file and parse it as JSON. Args: path: Path to a file containing JSON-encoded data. encoding: Encoding used in the file. Defaults to utf-8. Returns: A Python object representing the data encoded in the file. Raises: Exception: If the file could not...
res, out, err, user = logging_run(['--results-directory=/tmp-results'],
tmpdir = tempfile.mkdtemp() res, out, err, user = logging_run(['--results-directory=' + tmpdir],
def test_results_directory_absolute(self): # We run a configuration that should fail, to generate output, then # look for what the output results url was.
self.assertEqual(user.url, '/tmp-results/results.html')
self.assertEqual(user.url, os.path.join(tmpdir, 'results.html')) shutil.rmtree(tmpdir, ignore_errors=True)
def test_results_directory_absolute(self): # We run a configuration that should fail, to generate output, then # look for what the output results url was.
_log.fatal("Test got out of sync:\n|%s|\n|%s|" % (uri, actual_uri)) raise AssertionError("test out of sync")
if (not re.search("^file:///[a-z]:", uri) or uri.tolower() != actual_uri.tolower()): _log.fatal("Test got out of sync:\n|%s|\n|%s|" % (uri, actual_uri)) raise AssertionError("test out of sync")
def run_test(self, uri, timeoutms, checksum): output = [] error = [] crash = False timeout = False actual_uri = None actual_checksum = None
if not Git.in_working_directory(self.cwd): return (None, None)
def _credentials_from_git(self): if not Git.in_working_directory(self.cwd): return (None, None) try: return (Git.read_git_config(self.git_prefix + "username"), Git.read_git_config(self.git_prefix + "password")) except OSError, e: # Catch and ignore OSError exceptions such as "no such file # or directory" (OSError errno...
return self.path_from_chromium_base('webkit', 'data', 'layout_tests', 'platform', platform, 'LayoutTests')
return self.path_from_webkit_base('LayoutTests', 'platform', platform)
def _chromium_baseline_path(self, platform): if platform is None: platform = self.name() return self.path_from_chromium_base('webkit', 'data', 'layout_tests', 'platform', platform, 'LayoutTests')
Reviewer("Ariya Hidayat", ["ariya@sencha.com", "ariya.hidayat@gmail.com", "ariya@webkit.org"], "ariya"),
Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@sencha.com", "ariya@webkit.org"], "ariya"),
def __init__(self, name, email_or_emails, irc_nickname=None): Committer.__init__(self, name, email_or_emails, irc_nickname) self.can_review = True
return None
return (None, None)
def _find_failures(self, builder, revision): build = builder.build_for_revision(revision, allow_failed_lookups=True) if not build: print "No build for %s" % revision return None results = build.layout_test_results() if not results: print "No results build %s (r%s)" % (build._number, build.revision()) return None failur...
return None return failures
return (None, None) return (build, failures)
def _find_failures(self, builder, revision): build = builder.build_for_revision(revision, allow_failed_lookups=True) if not build: print "No build for %s" % revision return None results = build.layout_test_results() if not results: print "No results build %s (r%s)" % (build._number, build.revision()) return None failur...
failures = self._find_failures(builder, revision)
(build, failures) = self._find_failures(builder, revision)
def _walk_backwards_from(self, builder, start_revision, limit): flaky_test_statistics = {} all_previous_failures = set([]) one_time_previous_failures = set([]) for i in range(limit): revision = start_revision - i print "Analyzing %s ... " % revision, failures = self._find_failures(builder, revision) if failures == None...
print "Flaky tests: %s" % sorted(flaky_tests)
print "Flaky tests: %s %s" % (sorted(flaky_tests), previous_build.results_url())
def _walk_backwards_from(self, builder, start_revision, limit): flaky_test_statistics = {} all_previous_failures = set([]) one_time_previous_failures = set([]) for i in range(limit): revision = start_revision - i print "Analyzing %s ... " % revision, failures = self._find_failures(builder, revision) if failures == None...
def WriteDestinationInitalizationValidation(self, func, file): """Writes the client side destintion initialization validation.""" for arg in func.GetOriginalArgs(): arg.WriteDestinationInitalizationValidation(file, func)
def WriteDestinationInitalizationValidation(self, func, file): """Writes the client side destintion initialization validation.""" for arg in func.GetOriginalArgs(): arg.WriteDestinationInitalizationValidation(file, func)
need_validation_ = ['GLsizei*', 'GLboolean*', 'GLenum*', 'GLint*']
def __init__(self, info, type_handler): for key in info: setattr(self, key, info[key]) self.type_handler = type_handler if not 'type' in info: self.type = ''
def WriteDestinationInitalizationValidation(self, file, func): """Writes the client side destintion initialization validation.""" pass def WriteDestinationInitalizationValidatationIfNeeded(self, file, func): """Writes the client side destintion initialization validation if needed.""" parts = self.type.split(" ") if le...
def WriteClientSideValidationCode(self, file, func): """Writes the validation code for an argument.""" pass
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
def GetImmediateVersion(self): """Overridden from Argument.""" return None
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
def GetBucketVersion(self): """Overridden from Argument.""" if self.type == "const char*": return InputStringBucketArgument(self.name, self.type) return BucketPointerArgument(self.name, self.type)
def WriteDestinationInitalizationValidation(self, file): """Writes the client side destintion initialization validation.""" self.type_handler.WriteDestinationInitalizationValidation(self, file)
def WriteGLES2ImplementationHeader(self, file): """Writes the GLES2 Implemention declaration.""" self.type_handler.WriteGLES2ImplementationHeader(self, file)
func.WriteDestinationInitalizationValidation(file)
def WriteGLES2CLibImplementation(self, filename): """Writes the GLES2 c lib implementation.""" file = CHeaderWriter( filename, "// These functions emluate GLES2 over command buffers.\n")
"id" : 42, "title" : "Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.", "assigned_to_email" : _unassigned_email, "attachments" : [_patch1, _patch2], }
"id": 42, "title": "Bug with two r+'d and cq+'d patches, one of which has an " "invalid commit-queue setter.", "assigned_to_email": _unassigned_email, "attachments": [_patch1, _patch2], }
def _id_to_object_dictionary(*objects): dictionary = {} for thing in objects: dictionary[thing["id"]] = thing return dictionary
"is_green": True
"is_green": True,
def builder_statuses(self): return [{ "name": "Builder1", "is_green": True }, { "name": "Builder2", "is_green": True }]
return CommitMessage("CommitMessage1\nhttps://bugs.example.org/show_bug.cgi?id=42\n")
return CommitMessage("CommitMessage1\n" \ "https://bugs.example.org/show_bug.cgi?id=42\n")
def commit_message_for_local_commit(self, commit_id): if commit_id == "Commitish1": return CommitMessage("CommitMessage1\nhttps://bugs.example.org/show_bug.cgi?id=42\n") if commit_id == "Commitish2": return CommitMessage("CommitMessage2\nhttps://bugs.example.org/show_bug.cgi?id=75\n") raise Exception("Bogus commit_id i...
return CommitMessage("CommitMessage2\nhttps://bugs.example.org/show_bug.cgi?id=75\n")
return CommitMessage("CommitMessage2\n" \ "https://bugs.example.org/show_bug.cgi?id=75\n")
def commit_message_for_local_commit(self, commit_id): if commit_id == "Commitish1": return CommitMessage("CommitMessage1\nhttps://bugs.example.org/show_bug.cgi?id=42\n") if commit_id == "Commitish2": return CommitMessage("CommitMessage2\nhttps://bugs.example.org/show_bug.cgi?id=75\n") raise Exception("Bogus commit_id i...
return "DiffForRevision%s\nhttp://bugs.webkit.org/show_bug.cgi?id=12345" % revision
return "DiffForRevision%s\n" \ "http://bugs.webkit.org/show_bug.cgi?id=12345" % revision
def diff_for_revision(self, revision): return "DiffForRevision%s\nhttp://bugs.webkit.org/show_bug.cgi?id=12345" % revision
Reviewer("Timothy Hatcher", ["timothy@hatcher.name", "timothy@apple.com"], "xenon"),
Reviewer("Timothy Hatcher", ["timothy@apple.com", "timothy@hatcher.name"], "xenon"),
def __init__(self, name, email_or_emails, irc_nickname=None): Committer.__init__(self, name, email_or_emails, irc_nickname) self.can_review = True
parts = string.split('(')
parts = re.split("(?<=[^\"])\(", string)
def __FindSplit(self, string): """Finds a place to split a string.""" splitter = string.find('=') if splitter >= 0 and not string[splitter + 1] == '=' and splitter < 80: return splitter parts = string.split('(') fptr = re.compile('\*\w*\)') if len(parts) > 1: splitter = len(parts[0]) for ii in range(1, len(parts)): # D...
if splitter < 0:
if splitter < 0 or (splitter > 0 and string[splitter - 1] == '"'):
def __FindSplit(self, string): """Finds a place to split a string.""" splitter = string.find('=') if splitter >= 0 and not string[splitter + 1] == '=' and splitter < 80: return splitter parts = string.split('(') fptr = re.compile('\*\w*\)') if len(parts) > 1: splitter = len(parts[0]) for ii in range(1, len(parts)): # D...
def MakeOriginalArgString(self, prefix, add_comma = False):
def MakeOriginalArgString(self, prefix, add_comma = False, separator = ", "):
def MakeOriginalArgString(self, prefix, add_comma = False): """Gets the list of arguments as they are in GL.""" args = self.GetOriginalArgs() arg_string = ", ".join( ["%s%s" % (prefix, arg.name) for arg in args]) return self.__GetArgList(arg_string, add_comma)
arg_string = ", ".join(
arg_string = separator.join(
def MakeOriginalArgString(self, prefix, add_comma = False): """Gets the list of arguments as they are in GL.""" args = self.GetOriginalArgs() arg_string = ", ".join( ["%s%s" % (prefix, arg.name) for arg in args]) return self.__GetArgList(arg_string, add_comma)
return_string = "return "
comma = "" if len(func.GetOriginalArgs()): comma = " << " file.Write( ' GPU_CLIENT_LOG("%s" << "("%s%s << ")");\n' % (func.original_name, comma, func.MakeOriginalArgString( "", separator=' << ", " << '))) result_string = "%s result = " % func.return_type return_string = ( ' GPU_CLIENT_LOG("return:" << result)\n retu...
def WriteGLES2CLibImplementation(self, filename): """Writes the GLES2 c lib implementation.""" file = CHeaderWriter( filename, "// These functions emluate GLES2 over command buffers.\n")
(return_string, func.original_name,
(result_string, func.original_name,
def WriteGLES2CLibImplementation(self, filename): """Writes the GLES2 c lib implementation.""" file = CHeaderWriter( filename, "// These functions emluate GLES2 over command buffers.\n")
options, args = optparse.OptionParser().parse_args()
options, args = optparse.OptionParser().parse_args([])
def test_get_option__set(self): options, args = optparse.OptionParser().parse_args() options.foo = 'bar' port = base.Port(options=options) self.assertEqual(port.get_option('foo'), 'bar')
options, args = optparse.OptionParser().parse_args()
options, args = optparse.OptionParser().parse_args([])
def test_set_option_default__set(self): options, args = optparse.OptionParser().parse_args() options.foo = 'bar' port = base.Port(options=options) # This call should have no effect. port.set_option_default('foo', 'new_bar') self.assertEqual(port.get_option('foo'), 'bar')
self._cached_build_root = self._webkit_build_directory(["--top-level"]) return os.path.join(self._cached_build_root, self._options.configuration, *comps)
self._cached_build_root = self._webkit_build_directory([ "--configuration", self.flag_from_configuration(self._options.configuration), ]) return os.path.join(self._cached_build_root, *comps)
def _build_path(self, *comps): if not self._cached_build_root: self._cached_build_root = self._webkit_build_directory(["--top-level"]) return os.path.join(self._cached_build_root, self._options.configuration, *comps)
'layout_test')
'layout_tests')
def __init__(self, platform, options): self._file_dir = path_utils.PathFromBase('webkit', 'tools', 'layout_test') self._platform = platform self._options = options self._rebaselining_tests = [] self._rebaselined_tests = []
logging.debug('Executing javascript: ', js)
logging.debug('Executing javascript: %s', js)
def CallJavascriptFunc(self, function, args=[], tab_index=0, windex=0): """Executes a script which calls a given javascript function.
self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[1])
if port_name == 'chromium-gpu-linux': self.assertEqual(port._webkit_baseline_path('chromium-gpu-win'), paths[1]) self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[2]) else: self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[1])
def assertOverridesWorked(self, port_name): # test that we got the right port mock_options = mocktool.MockOptions(accelerated_compositing=None, accelerated_2d_canvas=None) port = chromium_gpu.get(port_name=port_name, options=mock_options) self.assertTrue(port._options.accelerated_compositing) self.assertTrue(port._opti...
file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url)
downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self._TriggerUnsafeDownload(os.path.basename(file_path))
def testSaveDangerousFile(self): """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg...
file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url)
downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self._TriggerUnsafeDownload(os.path.basename(file_path))
def testDeclineDangerousDownload(self): """Verify that we can decline dangerous downloads""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg)
file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url)
downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self._TriggerUnsafeDownload(os.path.basename(file_path))
def testNoUnsafeDownloadsOnRestart(self): """Verify that unsafe file should not show up on session restart.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadSta...
cmd.append('--pixel-tests')
logging.warn("This port does not yet support pixel tests.") self._port._options.no_pixel_tests = True
def __init__(self, port, image_path, driver_options): self._port = port self._driver_options = driver_options self._target = port._options.target self._image_path = image_path self._stdout_fd = None self._cmd = None self._env = None self._proc = None self._read_buffer = ''
URI.
URI. The 'pid' key-value pair may be omitted or invalid if the notification is closing.
def GetActiveNotifications(self): """Gets a list of the currently active/shown HTML5 notifications.
u'origin_url': 'http://www.corp.google.com/'},
u'origin_url': 'http://www.corp.google.com/', u'pid': 8505},
def GetActiveNotifications(self): """Gets a list of the currently active/shown HTML5 notifications.
u'origin_url': 'http://www.gmail.com/'}]
u'origin_url': 'http://www.gmail.com/', u'pid': 9291}]
def GetActiveNotifications(self): """Gets a list of the currently active/shown HTML5 notifications.
Return 1 if the two files are different, 0 if they are the same.
Return True if the two files are different, False if they are the same.
def diff_image(self, expected_filename, actual_filename, diff_filename=None): """Compare two image files and produce a delta image file.
result = 1
result = True
def diff_image(self, expected_filename, actual_filename, diff_filename=None): """Compare two image files and produce a delta image file.
result = subprocess.call(cmd)
if subprocess.call(cmd) == 0: return False
def diff_image(self, expected_filename, actual_filename, diff_filename=None): """Compare two image files and produce a delta image file.
subprocess.call(cmd, shell=shell)
return subprocess.call(cmd, shell=shell) else: return 0
def _RunCommand(cmd, dry_run, shell=False, echo_cmd=True): """Runs the command if dry_run is false, otherwise just prints the command.""" if echo_cmd: print cmd # TODO(wtc): Check the return value of subprocess.call, which is the return # value of the command. if not dry_run: subprocess.call(cmd, shell=shell)
_RunCommand(cmd, options.dry_run, shell=True)
gclient_exit = _RunCommand(cmd, options.dry_run, shell=True) if gclient_exit != 0: print 'gclient aborted with status %s' % gclient_exit _ReleaseLock(lock_file, lock_filename) sys.exit(1)
def main(options, args): """Runs all the selected tests for the given build type and target.""" # Create the lock file to prevent another instance of this script from # running. lock_filename = os.path.join(options.source_dir, LOCK_FILE) try: lock_file = os.open(lock_filename, os.O_CREAT | os.O_EXCL | os.O_TRUNC | os.O...
print 'Platform "%s" unrecognized, don\'t know how to proceed'
print 'Platform "%s" unrecognized, aborting' % sys.platform
def main(options, args): """Runs all the selected tests for the given build type and target.""" # Create the lock file to prevent another instance of this script from # running. lock_filename = os.path.join(options.source_dir, LOCK_FILE) try: lock_file = os.open(lock_filename, os.O_CREAT | os.O_EXCL | os.O_TRUNC | os.O...
'glue', 'editor_client_impl.cc')
'api', 'src','EditorClientImpl.cc')
def AddWebKitEditorActions(actions): """Add editor actions from editor_client_impl.cc. Arguments: actions: set of actions to add to. """ action_re = re.compile(r'''\{ [\w']+, +\w+, +"(.*)" +\},''') editor_file = os.path.join(path_utils.ScriptDir(), '..', '..', 'webkit', 'glue', 'editor_client_impl.cc') for line in op...
action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(')
global number_of_files_total number_of_files_total = number_of_files_total + 1 action_re = re.compile(r'UserMetricsAction\("([^"]*)')
def GrepForActions(path, actions): """Grep a source file for calls to UserMetrics functions. Arguments: path: path to the file actions: set of actions to add to """ action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(') computed_action_re...
elif other_action_re.search(line): if os.path.basename(path) != 'user_metrics.cc': print >>sys.stderr, 'WARNING: %s has funny RecordAction' % path
def GrepForActions(path, actions): """Grep a source file for calls to UserMetrics functions. Arguments: path: path to the file actions: set of actions to add to """ action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(') computed_action_re...
print >>sys.stderr, 'WARNING: %s has RecordComputedAction' % path
print >>sys.stderr, 'WARNING: {0} has RecordComputedAction at {1}'.\ format(path, line_number)
def GrepForActions(path, actions): """Grep a source file for calls to UserMetrics functions. Arguments: path: path to the file actions: set of actions to add to """ action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(') computed_action_re...
if ext == '.cc':
if ext in ('.cc', '.mm', '.c', '.m'):
def WalkDirectory(root_path, actions): for path, dirs, files in os.walk(root_path): if '.svn' in dirs: dirs.remove('.svn') for file in files: ext = os.path.splitext(file)[1] if ext == '.cc': GrepForActions(os.path.join(path, file), actions)
AddWebKitEditorActions(actions)
def main(argv): actions = set() AddComputedActions(actions) AddWebKitEditorActions(actions) # Walk the source tree to process all .cc files. chrome_root = os.path.join(path_utils.ScriptDir(), '..') WalkDirectory(chrome_root, actions) webkit_root = os.path.join(path_utils.ScriptDir(), '..', '..', 'webkit') WalkDirector...
proc += ["-logdir", (os.getcwd() + "\\" + self.temp_dir)]
proc += ["-logdir", self.temp_dir]
def ToolCommand(self): """Get the valgrind command to run.""" tool_name = self.ToolName()
ssl_client_auth, ssl_client_cas):
ssl_client_auth, ssl_client_cas, ssl_bulk_ciphers):
def __init__(self, server_address, request_hander_class, cert_path, ssl_client_auth, ssl_client_cas): s = open(cert_path).read() x509 = tlslite.api.X509() x509.parse(s) self.cert_chain = tlslite.api.X509CertChain([x509]) s = open(cert_path).read() self.private_key = tlslite.api.parsePEMKey(s, private=True) self.ssl_cli...
options.ssl_client_auth, options.ssl_client_ca)
options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher)
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...
'should indicate that it supports the CA contained ' 'in the specified certificate file')
'should include the CA named in the subject of ' 'the DER-encoded certificate contained in the ' 'specified file. This option may appear multiple ' 'times, indicating multiple CA names should be ' 'sent in the request.') option_parser.add_option('', '--ssl-bulk-cipher', action='append', help='Specify the bulk encryptio...
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...
arg.WriteClientSideValidationCode(file)
arg.WriteClientSideValidationCode(file, func)
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') 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)): file.Write("%s %s(%s) {\n" % (func...
arg.WriteClientSideValidationCode(file)
arg.WriteClientSideValidationCode(file, func)
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') 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)): file.Write("%s %s(%s) {\n" % (func...
SetGLError(GL_INVALID_OPERATION);
SetGLError(GL_INVALID_OPERATION, "%(name)s: %(id)s reserved id");
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') 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)): file.Write("%s %s(%s) {\n" % (func...
SetGLError(GL_INVALID_ENUM);
SetGLError(GL_INVALID_ENUM, "gl%(func_name)s: invalid enum");
code = """ typedef %(func_name)s::Result Result;
SetGLError(error);
SetGLError(error, NULL);
code = """ typedef %(func_name)s::Result Result;
def WriteValidationCode(self, file):
def WriteValidationCode(self, file, func):
def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass
def WriteClientSideValidationCode(self, file):
def WriteClientSideValidationCode(self, file, func):
def WriteClientSideValidationCode(self, file): """Writes the validation code for an argument.""" pass
def WriteValidationCode(self, file):
def WriteValidationCode(self, file, func):
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")
file.Write(" SetGLError(GL_INVALID_VALUE);\n")
file.Write(" SetGLError(GL_INVALID_VALUE, \"gl%s: %s < 0\");\n" % (func.original_name, self.name))
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):
def WriteClientSideValidationCode(self, file, func):
def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n")
file.Write(" SetGLError(GL_INVALID_VALUE);\n")
file.Write(" SetGLError(GL_INVALID_VALUE, \"gl%s: %s < 0\");\n" % (func.original_name, self.name))
def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n")
def WriteValidationCode(self, file):
def WriteValidationCode(self, file, func):
def WriteValidationCode(self, file): file.Write(" if (!Validate%s(%s)) {\n" % (self.local_type, self.name)) file.Write(" SetGLError(%s);\n" % self.gl_error) file.Write(" return error::kNoError;\n") file.Write(" }\n")
file.Write(" SetGLError(%s);\n" % self.gl_error)
file.Write(" SetGLError(%s, \"gl%s: %s %s\");\n" % (self.gl_error, func.original_name, self.name, self.gl_error))
def WriteValidationCode(self, file): file.Write(" if (!Validate%s(%s)) {\n" % (self.local_type, self.name)) file.Write(" SetGLError(%s);\n" % self.gl_error) file.Write(" return error::kNoError;\n") file.Write(" }\n")