rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
if not cur_leak_signature: print 'Missing leak signature for the following stack: ' for frame in cur_stack: print ' ' + frame print 'Aborting...' return 3
def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports.
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testZip(self): """Download a zip and verify that it downloaded correctly. Also verify that the download shelf showed up. """ test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_path = os.path.join(test_dir, 'a_zip_file.zip') file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.pat...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testZipInIncognito(self): """Download and verify a zip in incognito window.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_path = os.path.join(test_dir, 'a_zip_file.zip') file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'a...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testSaveDangerousFile(self): """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
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)) os.path.exists(downloaded_pkg) and os.remove(...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testRemoveDownload(self): """Verify that we can remove a download.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_path = os.path.join(test_dir, 'a_zip_file.zip') file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'a_zip_file...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testBigZip(self): """Verify that we can download a 1GB file.
os.path.exists(expected_filename) and os.remove(expected_filename)
self._ClearLocalDownloadState(expected_filename)
def testFileRenaming(self): """Test file renaming when downloading a already-existing filename.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_url = 'file://%s' % os.path.join(test_dir, 'a_zip_file.zip') download_dir = self.GetDownloadDirectory().value()
os.path.exists(downloaded_file) and os.remove(downloaded_file)
self._ClearLocalDownloadState(downloaded_file)
def _CreateFile(name): """Create and fill the given file with some junk.""" fp = open(name, 'w') # name could be unicode print >>fp, 'This is a junk file named %s. ' % repr(name) * 100 fp.close()
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
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)) os.path.exists(downloaded_p...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testPauseAndResume(self): """Verify that pause and resume work while downloading a file.
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testCancelDownload(self): """Verify that we can cancel a download.""" # Create a big file (250 MB) on the fly, so that the download won't finish # before being cancelled. file_path = self._MakeFile(2**28) file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(),...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testDownloadsPersistence(self): """Verify that download history persists on session restart.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_url = self.GetFileURLForPath(os.path.join(test_dir, 'a_zip_file.zip')) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'a_zip_...
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
self._ClearLocalDownloadState(downloaded_pkg)
def testDownloadTheme(self): """Verify downloading and saving a theme file installs the theme.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'extensions') file_url = self.GetFileURLForPath(os.path.join(test_dir, 'theme.crx')) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'theme.crx') ...
def remove_first_line_comment(text): return re.compile(r'^<!--.*?-->\s*', re.DOTALL).sub('', text)
def construct_script(name): return "<script src=\"" + name + "\"></script>\n"
def remove_first_line_comment(text): return re.compile(r'^<!--.*?-->\s*', re.DOTALL).sub('', text)
def translate_includes(text): include_mapping = { "js-test-style.css": "../../js/resources", "js-test-pre.js": "../../js/resources", "js-test-post.js": "../../js/resources", "desktop-gl-constants.js": "resources", } for filename, path in include_mapping.items(): search = r'(?:[^"\'= ]*/)?' + re.escape(filename) repl...
def construct_style(name): return "<link rel=\"stylesheet\" href=\"" + name + "\">"
def translate_includes(text): # Mapping of single filename to relative path under WebKit root. # Assumption: these filenames are globally unique. include_mapping = { "js-test-style.css": "../../js/resources", "js-test-pre.js": "../../js/resources", "js-test-post.js": "../../js/resources", "desktop-gl-constants.js": "re...
def translate_khronos_test(text): """ This method translates the contents of a Khronos test to a WebKit test. """
class TestTranslation(unittest.TestCase): def assert_unchanged(self, text): self.assertEqual(text, webgl.translate_khronos_test(text))
def translate_khronos_test(text): """ This method translates the contents of a Khronos test to a WebKit test. """ translateFuncs = [ remove_first_line_comment, translate_includes, ] for f in translateFuncs: text = f(text) return text
translateFuncs = [ remove_first_line_comment, translate_includes, ]
def assert_translate(self, input, output): self.assertEqual(output, webgl.translate_khronos_test(input))
def translate_khronos_test(text): """ This method translates the contents of a Khronos test to a WebKit test. """ translateFuncs = [ remove_first_line_comment, translate_includes, ] for f in translateFuncs: text = f(text) return text
for f in translateFuncs: text = f(text)
def test_simple_unchanged(self): self.assert_unchanged("") self.assert_unchanged("<html></html>")
def translate_khronos_test(text): """ This method translates the contents of a Khronos test to a WebKit test. """ translateFuncs = [ remove_first_line_comment, translate_includes, ] for f in translateFuncs: text = f(text) return text
return text
def test_header_strip(self): single_line_header = "<!-- single line header. -->" multi_line_header = """<!-- this is a multi-line header. it should all be removed too. -->""" text = "<html></html>" self.assert_translate(single_line_header, "") self.assert_translate(single_line_header + text, text) self.assert_translat...
def translate_khronos_test(text): """ This method translates the contents of a Khronos test to a WebKit test. """ translateFuncs = [ remove_first_line_comment, translate_includes, ] for f in translateFuncs: text = f(text) return text
def update_file(in_filename, out_dir): out_filename = os.path.join(out_dir, os.path.basename(in_filename)) _log.debug("Processing " + in_filename) with open(in_filename, 'r') as in_file: with open(out_filename, 'w') as out_file: out_file.write(translate_khronos_test(in_file.read())) def update_directory(in_dir, ou...
if __name__ == '__main__': unittest.main()
def update_file(in_filename, out_dir): # check in_filename exists # check out_dir exists out_filename = os.path.join(out_dir, os.path.basename(in_filename)) _log.debug("Processing " + in_filename) with open(in_filename, 'r') as in_file: with open(out_filename, 'w') as out_file: out_file.write(translate_khronos_test(in...
EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); EXPECT_TRUE(Get%(resource_type)sInfo(kNewServiceId) != NULL);
EXPECT_TRUE(Get%(resource_type)sInfo(kNewClientId) != NULL);
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
code = """ if (IsReservedId(%(id)s)) {
code = """ if (Is%(type)sReservedId(%(id)s)) {
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...
id_allocator_.MarkAsUsed(%(id)s);
%(lc_type)s_id_allocator_.MarkAsUsed(%(id)s);
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...
file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n"
file.Write(" if (!%sHelper(n, %s)) {\n"
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n" " return error::kInvalidArguments;\n" " }\n" % (func.name, func.GetLastOriginalArg().name))
file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n"
file.Write(" if (!%sHelper(n, %s)) {\n"
def WriteImmediateHandlerImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n" " return error::kInvalidArguments;\n" " }\n" % (func.original_name, func.GetLastOriginalArg().name))
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" MakeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
code = """%(return_type)s %(name)s(%(typed_args)s) { MakeIds(&%(resource_type)s_id_allocator_, %(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % { 'return_type': func.return_type, 'name': func.original_name, 'typed_args': func.MakeTypedOriginalArgString(""), 'args': func.MakeOriginalArgString(""...
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" MakeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func...
EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId);
EXPECT_TRUE(Get%(resource_name)sInfo(kNewClientId) != NULL);
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
self.WriteValidUnitTest(func, file, valid_test)
self.WriteValidUnitTest(func, file, valid_test, { 'resource_name': func.name[3:-1], })
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId);
EXPECT_TRUE(Get%(resource_name)sInfo(kNewClientId) != NULL);
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
self.WriteValidUnitTest(func, file, valid_test)
self.WriteValidUnitTest(func, file, valid_test, { 'resource_name': func.original_name[3:-1], })
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId);
EXPECT_TRUE(Get%(resource_type)sInfo(kNewClientId) != NULL);
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
file.Write(" %sHelper(%s);\n" %
file.Write(" if (!%sHelper(%s)) {\n" %
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 client_id = c.client_id;\n") file.Write(" %sHelper(%s);\n" % (func.name, func.MakeCmdArgString("")))
file.Write(" MakeIds(1, &client_id);\n")
file.Write(" MakeIds(&program_and_shader_id_allocator_, 1, &client_id);\n")
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" GLuint client_id;\n") file.Write(" MakeIds(1, &client_id);\n") file.Write(" helper_->%s(%s);\n" % (func.name,...
EXPECT_EQ(GetServiceId(kNewClientId), 0u);
EXPECT_TRUE( Get%(upper_resource_name)sInfo(client_%(resource_name)s_id_) == NULL);
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
EXPECT_CALL(*gl_, %(gl_func_name)s(1, Pointee(0))) .Times(1);
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
EXPECT_EQ(GetServiceId(kNewClientId), 0u);
EXPECT_TRUE( Get%(upper_resource_name)sInfo(client_%(resource_name)s_id_) == NULL);
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
EXPECT_CALL(*gl_, %(gl_func_name)s(1, Pointee(0))) .Times(1);
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
file.Write(" DeleteGLObjects<GL%sHelper>(n, %s);\n" %
file.Write(" %sHelper(n, %s);\n" %
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" DeleteGLObjects<GL%sHelper>(n, %s);\n" % (func.name, func.GetLastOriginalArg().name))
file.Write(" DeleteGLObjects<GL%sHelper>(n, %s);\n" %
file.Write(" %sHelper(n, %s);\n" %
def WriteImmediateHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" DeleteGLObjects<GL%sHelper>(n, %s);\n" % (func.original_name, func.GetLastOriginalArg().name))
file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString(""))
file.Write(" FreeIds(&%s_id_allocator_, %s);\n" % (func.name[6:-1].lower(), func.MakeOriginalArgString("")))
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" 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.MakeOri...
file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" G...
pass
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode...
file.Write(" %s %s;\n" % (self.type, self.name)) file.Write(" if (!id_manager()->GetServiceId(c.%s, &%s)) {\n" % (self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
file.Write(" %s %s = c.%s;\n" % (self.type, self.name, self.name))
def WriteGetCode(self, file): """Overridden from Argument.""" file.Write(" %s %s;\n" % (self.type, self.name)) file.Write(" if (!id_manager()->GetServiceId(c.%s, &%s)) {\n" % (self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 1 def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if self.resource_type == "Texture": return ("client_buffer_id_", "kNoError", "GL_INVALID_OPERATION") return ("client_texture_id_", "kNo...
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 1
file.Write(" if (%s != 0 && !id_manager()->GetServiceId(%s, &%s)) {\n" % (self.name, self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
def WriteGetCode(self, file): """Overridden from Argument.""" file.Write(" %s %s = c.%s;\n" % (self.type, self.name, self.name)) file.Write(" if (%s != 0 && !id_manager()->GetServiceId(%s, &%s)) {\n" % (self.name, self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::k...
if self.resource_type == "Texture": return ("client_buffer_id_", "kNoError", "GL_INVALID_OPERATION") return ("client_texture_id_", "kNoError", "GL_INVALID_OPERATION")
return ("kInvalidClientId", "kNoError", "GL_INVALID_VALUE")
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if self.resource_type == "Texture": return ("client_buffer_id_", "kNoError", "GL_INVALID_OPERATION") return ("client_texture_id_", "kNoError", "GL_INVALID_OPERATION")
BUILD_EXE_NAME = "chrome"
BUILD_EXE_NAME = 'chrome'
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_A...
BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium"
BUILD_EXE_NAME = 'Chromium.app/Contents/MacOS/Chromium'
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_A...
BUILD_EXE_NAME = "chrome.exe"
BUILD_EXE_NAME = 'chrome.exe'
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_A...
print("Could not retrieve the download. Sorry.")
print('Could not retrieve the download. Sorry.')
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...
print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME)
print 'Unziping ...' UnzipFilenameToDir(BUILD_ZIP_NAME, os.curdir)
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...
print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags))
exe = os.path.join(os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME) cmd = '%s %s' % (exe, flags) print 'Running %s' % cmd os.system(cmd)
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...
response = raw_input("\nBuild %d is [(g)ood/(b)ad]: " % int(rev)) if response and response in ("g", "b"): return response == "g"
response = raw_input('\nBuild %d is [(g)ood/(b)ad]: ' % int(rev)) if response and response in ('g', 'b'): return response == 'g'
def AskIsGoodBuild(rev): """Ask the user whether build |rev| is good or bad.""" # Loop until we get a response that we can parse. while True: response = raw_input("\nBuild %d is [(g)ood/(b)ad]: " % int(rev)) if response and response in ("g", "b"): return response == "g"
BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL)
BUILD_LATEST_URL = '%s/LATEST' % (BUILD_BASE_URL)
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""):
bad_rev = raw_input('Bad revision [HEAD:%d]: ' % latest) if (bad_rev == ''):
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: "))
print('Could not determine latest revision. This could be bad...') bad_rev = int(raw_input('Bad revision: '))
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
good_rev = int(raw_input("Last known good [0]: "))
good_rev = int(raw_input('Last known good [0]: '))
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
print "We don't have enough builds to bisect. revlist: %s" % revlist
print 'We don\'t have enough builds to bisect. revlist: %s' % revlist
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
print("%d candidates. %d tries left." %
print('%d candidates. %d tries left.' %
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
print("Candidates: %s" % revlist[good:bad])
print('Candidates: %s' % revlist[good:bad])
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:")
print('You are probably looking for build %d.' % revlist[bad]) print('CHANGELOG URL:')
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
print("Built at revision:")
print('Built at revision:')
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = ch...
"--ui-test-action-max-timeout=180000",
"--ui-test-action-max-timeout=280000",
def TestUI(self): return self.SimpleTest("chrome", "ui_tests", valgrind_test_args=[ "--timeout=180000", "--trace_children", "--indirect"], cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=180000", "--ui-test-sleep-timeout=120000", "--ui-test-terminate-timeout=12000...
self._print.print_expected(tests_run_msg)
self._printer.print_expected(tests_run_msg)
def prepare_lists_and_print_output(self): """Create appropriate subsets of test lists and returns a ResultSummary object. Also prints expected test counts. """
if re.search(TsanAnalyzer.TSAN_WARNING_DESCRIPTION, self.line_):
if (re.search(TsanAnalyzer.TSAN_WARNING_DESCRIPTION, self.line_) and not common.IsWindows()):
def ParseReportFile(self, filename): self.cur_fd_ = open(filename, 'r')
print('usage: %s order.html input_file_1 input_file_2 ... '
print('usage: %s order.html input_source_dir_1 input_source_dir_2 ... '
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor =...
full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor =...
if not input_file_name in full_paths: print('A full path to %s isn\'t specified in command line. ' 'Probably, you have an obsolete script entry in %s' % (input_file_name, argv[1]))
full_path = expander.expand(input_file_name) if (full_path is None): raise Exception('File %s referenced in %s not found on any source paths, ' 'check source tree for consistency' % (input_file_name, input_file_name))
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor =...
input_file = open(full_paths[input_file_name], 'r')
input_file = open(full_path, 'r')
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor =...
self.assert_lint('void NPN_Status(NPP, const char*)') self.assert_lint('NPError NPP_SetWindow(NPP instance, NPWindow *window)') self.assert_lint('NPObject* NP_Allocate(NPP, NPClass*)')
self.assert_lint('void NPN_Status(NPP, const char*)', '') self.assert_lint('NPError NPP_SetWindow(NPP instance, NPWindow *window)', '') self.assert_lint('NPObject* NP_Allocate(NPP, NPClass*)', '')
def test_names(self): name_underscore_error_message = " is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4]" name_tooshort_error_message = " is incorrectly named. Don't use the single letter 'l' as an identifier name. [readability/naming] [4]"
'ENABLE_JIT', 'ENABLE_EXECUTABLE_ALLOCATOR_DEMAND', 'BUILDING_%s' % build_port.upper()]
'ENABLE_JIT', 'BUILDING_%s' % build_port.upper()]
def get_config(): waf_configname = config.upper().strip() if building_on_win32: isReleaseCRT = (config == 'Release') if build_port == 'wx': if Options.options.wxpython: isReleaseCRT = True if isReleaseCRT: waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL' else: waf_configname = waf_configname + ' CRT_MULTITHR...
short_options = 'f:i:o:t:h' long_options = ['file=', 'help']
short_options = 'e:f:i:o:t:h' long_options = ['eval=', 'file=', 'help']
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
if o in ('-f', '--file'):
if o in ('-e', '--eval'): try: evals.update(dict([a.split('=',1)])) except ValueError: raise Usage("-e requires VAR=VAL") elif o in ('-f', '--file'):
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
sys.stderr.write('Use -h to get help.')
sys.stderr.write('; Use -h to get help.\n')
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
for key, val in evals.iteritems(): values[key] = str(eval(val, globals(), values))
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
json_results_generator.JSONResultsGenerator(
json_results_generator.JSONResultsGenerator(port_obj,
def __init__(self, options): self._options = options
if self.command == 'POST':
if self.command == 'POST' or self.command == 'PUT':
def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents."""
if self.command == 'POST':
if self.command == 'POST' or self.command == 'PUT' :
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
close_fds=True)
close_fds=close_flag)
def __init__(self, port, image_path, options): self._port = port self._options = options self._target = port._options.target self._image_path = image_path
if not lock_path:
self._lock_path = lock_path if not self._lock_path:
def __init__(self, lock_path, lock_file_prefix="WebKitHttpd.lock.", guard_lock="WebKit.lock"): if not lock_path: self._lock_path = tempfile.gettempdir() self._lock_file_prefix = lock_file_prefix self._lock_file_path_prefix = os.path.join(self._lock_path, self._lock_file_prefix) self._guard_lock_file = os.path.join(self...
break
return True
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_EXCL) self._process_lock_f...
pass
if time.time() - start_time > self._guard_lock_max_wait: _log.debug("Lock does not created: %s" % str(sys.exc_info())) return False
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_EXCL) self._process_lock_f...
pass
return True
def _check_port_build(self): # Ports can override this method to do additional checks. pass
return '/usr/sbin/httpd'
if not self._cached_apache_path: for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]: if os.path.exists(path): self._cached_apache_path = path break if not self._cached_apache_path: _log.error("Could not find apache. Not installed or unknown path.") return self._cached_apache_path
def _path_to_apache(self): return '/usr/sbin/httpd'
def RewritePath(path, sysroot): """Rewrites a path by prefixing it with the sysroot if it is absolute."""
def RewritePath(path, opts): """Rewrites a path by stripping the prefix and prepending the sysroot.""" sysroot = opts.sysroot prefix = opts.strip_prefix
def RewritePath(path, sysroot): """Rewrites a path by prefixing it with the sysroot if it is absolute.""" if os.path.isabs(path) and not path.startswith(sysroot): path = path.lstrip('/') return os.path.join(sysroot, path) else: return path
def RewriteLine(line, sysroot):
def RewriteLine(line, opts):
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = Rewrit...
args[i] = RewritePath(args[i], sysroot)
args[i] = RewritePath(args[i], opts)
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = Rewrit...
args[i] = prefix + RewritePath(args[i][len(prefix):], sysroot)
args[i] = prefix + RewritePath(args[i][len(prefix):], opts)
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = Rewrit...
try: sysroot = argv[1] except IndexError: sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) return 1
parser = optparse.OptionParser() parser.add_option('-s', '--sysroot', default='/', help='sysroot to prepend') parser.add_option('-p', '--strip-prefix', default='', help='prefix to strip') opts, args = parser.parse_args(argv[1:])
def main(argv): try: sysroot = argv[1] except IndexError: sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) return 1 for line in sys.stdin.readlines(): line = RewriteLine(line.strip(), sysroot) print line return 0
line = RewriteLine(line.strip(), sysroot)
line = RewriteLine(line.strip(), opts)
def main(argv): try: sysroot = argv[1] except IndexError: sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) return 1 for line in sys.stdin.readlines(): line = RewriteLine(line.strip(), sysroot) print line return 0
return [patch for patch in self.patches() if ( patch.in_rietveld() == "?" or patch.in_rietveld() == None and patch.review() == "?")]
return [patch for patch in self.patches() if patch.in_rietveld() == None]
def in_rietveld_queue_patches(self): return [patch for patch in self.patches() if ( patch.in_rietveld() == "?" or patch.in_rietveld() == None and patch.review() == "?")]
def _fetch_rietveld_queue_patch(self, query_url):
def fetch_first_patch_from_rietveld_queue(self): query_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=notsubstring&value0-0-0=in-rietveld&field0-1-0=attachments.ispatch&type0-1-0=equals&value0-1-0=1&order=Last+C...
def _fetch_rietveld_queue_patch(self, query_url): bugs = self._fetch_bug_ids_advanced_query(query_url) if not len(bugs): return None
def fetch_first_patch_from_rietveld_queue(self): rietveld_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=in-rietveld%3F&order=Last+Changed" patch = self._fetch_rietveld_queue_patch(rietv...
def _fetch_rietveld_queue_patch(self, query_url): bugs = self._fetch_bug_ids_advanced_query(query_url) if not len(bugs): return None
try: self.browser['flag_type-4'] = ('?',) except ControlNotFoundError, e: pass
def _fill_attachment_form(self, description, patch_file_object, comment_text=None, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=False, bug_id=None): self.browser['description'] = description self.browser['ispatch'] = ("1",) self.browser['flag_type-1'] = ('?',) if mark_for_review else ('X',)
commit_ids = self.run(["git", "log", "--pretty=format:%H", "-%s" % limit, "--", path]).splitlines()
commit_ids = self.run(["git", "log", "--remove-empty", "--pretty=format:%H", "-%s" % limit, "--", path]).splitlines()
def revisions_changing_file(self, path, limit=5): commit_ids = self.run(["git", "log", "--pretty=format:%H", "-%s" % limit, "--", path]).splitlines() return filter(lambda revision: revision, map(self.svn_revision_from_git_commit, commit_ids))
def CollectTranslatedStrings():
def CollectTranslatedStrings(branding):
def CollectTranslatedStrings(): """Collects all the translations for all the strings specified by kStringIds. Returns a list of tuples of (string_id, language, translated string). The list is sorted by language codes.""" kGeneratedResourcesPath = os.path.join(path_utils.ScriptDir(), '..', '..', '..', 'app/google_chrome...
'..', 'app/google_chrome_strings.grd')
'..', strings_file)
def CollectTranslatedStrings(): """Collects all the translations for all the strings specified by kStringIds. Returns a list of tuples of (string_id, language, translated string). The list is sorted by language codes.""" kGeneratedResourcesPath = os.path.join(path_utils.ScriptDir(), '..', '..', '..', 'app/google_chrome...
'google_chrome_strings*.xtb'))
translation_files))
def CollectTranslatedStrings(): """Collects all the translations for all the strings specified by kStringIds. Returns a list of tuples of (string_id, language, translated string). The list is sorted by language codes.""" kGeneratedResourcesPath = os.path.join(path_utils.ScriptDir(), '..', '..', '..', 'app/google_chrome...
translated_strings = CollectTranslatedStrings()
branding = '' if (argv > 2): branding = argv[2] translated_strings = CollectTranslatedStrings(branding)
def main(argv): translated_strings = CollectTranslatedStrings() kFilebase = os.path.join(argv[1], 'installer_util_strings') WriteRCFile(translated_strings, kFilebase) WriteHeaderFile(translated_strings, kFilebase)
print 'Usage:\n %s <output_directory>' % sys.argv[0]
print 'Usage:\n %s <output_directory> [branding]' % sys.argv[0]
def main(argv): translated_strings = CollectTranslatedStrings() kFilebase = os.path.join(argv[1], 'installer_util_strings') WriteRCFile(translated_strings, kFilebase) WriteHeaderFile(translated_strings, kFilebase)