rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def Execute(self): super(ThreadSanitizerWindows, self).Execute() return 0
def Analyze(self, check_sanity=False): filenames = glob.glob(self.temp_dir + "/tsan.*") analyzer = tsan_analyze.TsanAnalyzer(self._source_dir) ret = analyzer.Report(filenames, check_sanity) if ret != 0: logging.info(self.INFO_MESSAGE) return ret
9ed558436290b29292c279b4a3235675f3372aae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9ed558436290b29292c279b4a3235675f3372aae/valgrind_test.py
json_results_generator.JSONResultsGenerator(
json_results_generator.JSONResultsGenerator(port_obj,
def __init__(self, options): self._options = options
7cc949cabfe8f93d4a777c9be8277aa573ca846e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7cc949cabfe8f93d4a777c9be8277aa573ca846e/test_output_xml_to_json.py
path = self.request.path
path = os.path.realpath(os.path.join('/', self.request.path))
def get(self): path = self.request.path # special path to invoke the unit tests # TODO(nickbaum): is there a less ghetto way to invoke the unit test? if path == "/test/": self.unitTest() return # if root, redirect to index.html # TODO(nickbaum): this doesn't handle /chrome/extensions/trunk, etc if (path == "/chrome/extensions") or (path == "chrome/extensions/"): self.redirect("/chrome/extensions/index.html") return # else remove prefix if(path[:18] == "/chrome/extensions"): path = path[18:] # TODO(nickbaum): there's a subtle bug here: if there are two instances of the app, # their default caches will override each other. This is bad! result = memcache.get(path) if result is None: logging.info("Cache miss: " + path) url = self.getSrcUrl(path) if (url[1] is not Channel.TRUNK) and (url[0] != "http://src.chromium.org/favicon.ico"): branch = self.getBranch(url[1]) url = url[0] % branch else: url = url[0] logging.info("Path: " + self.request.path) logging.info("Url: " + url) try: result = urlfetch.fetch(url + self.request.query_string) if result.status_code != 200: logging.error("urlfetch failed: " + url) # TODO(nickbaum): what should we do when the urlfetch fails? except: logging.error("urlfetch failed: " + url) # TODO(nickbaum): what should we do when the urlfetch fails? try: if not memcache.add(path, result, DEFAULT_CACHE_TIME): logging.error("Memcache set failed.") except: logging.error("Memcache set failed.") for key in result.headers: self.response.headers[key] = result.headers[key] self.response.out.write(result.content)
01441792ed84697b412d5ca25fcffa1d67991d40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/01441792ed84697b412d5ca25fcffa1d67991d40/chromeextensionsdocs.py
if path == "/test/":
if path == "/test":
def get(self): path = self.request.path # special path to invoke the unit tests # TODO(nickbaum): is there a less ghetto way to invoke the unit test? if path == "/test/": self.unitTest() return # if root, redirect to index.html # TODO(nickbaum): this doesn't handle /chrome/extensions/trunk, etc if (path == "/chrome/extensions") or (path == "chrome/extensions/"): self.redirect("/chrome/extensions/index.html") return # else remove prefix if(path[:18] == "/chrome/extensions"): path = path[18:] # TODO(nickbaum): there's a subtle bug here: if there are two instances of the app, # their default caches will override each other. This is bad! result = memcache.get(path) if result is None: logging.info("Cache miss: " + path) url = self.getSrcUrl(path) if (url[1] is not Channel.TRUNK) and (url[0] != "http://src.chromium.org/favicon.ico"): branch = self.getBranch(url[1]) url = url[0] % branch else: url = url[0] logging.info("Path: " + self.request.path) logging.info("Url: " + url) try: result = urlfetch.fetch(url + self.request.query_string) if result.status_code != 200: logging.error("urlfetch failed: " + url) # TODO(nickbaum): what should we do when the urlfetch fails? except: logging.error("urlfetch failed: " + url) # TODO(nickbaum): what should we do when the urlfetch fails? try: if not memcache.add(path, result, DEFAULT_CACHE_TIME): logging.error("Memcache set failed.") except: logging.error("Memcache set failed.") for key in result.headers: self.response.headers[key] = result.headers[key] self.response.out.write(result.content)
01441792ed84697b412d5ca25fcffa1d67991d40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/01441792ed84697b412d5ca25fcffa1d67991d40/chromeextensionsdocs.py
test_dir = os.path.join(os.path.abspath(self.DataDir()), 'history')
test_dir = os.path.join(os.path.abspath(self.DataDir()), 'History')
def testRedirectHistory(self): """HTTP meta-refresh redirects should have separate history entries.""" assert not self.GetHistoryInfo().History(), 'Expecting clean history.' test_dir = os.path.join(os.path.abspath(self.DataDir()), 'history') file_url = self.GetFileURLForPath(os.path.join(test_dir, 'redirector.html')) landing_url = self.GetFileURLForPath(os.path.join(test_dir, 'landing.html')) tab = self.GetBrowserWindow(0).GetTab(0) tab.NavigateToURLBlockUntilNavigationsComplete(pyauto.GURL(file_url), 2) self.assertEqual(landing_url, self.GetActiveTabURL().spec()) # We should have two history items history = self.GetHistoryInfo().History() self.assertEqual(2, len(history)) self.assertEqual(landing_url, history[0]['url'])
b6eb899cf3badbb687af46cb2af2ff19a73ca7ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b6eb899cf3badbb687af46cb2af2ff19a73ca7ef/history.py
'xml' : 'text/xml', 'pdf' : 'application/pdf'
'pdf' : 'application/pdf', 'xml' : 'text/xml'
def __init__(self, request, client_address, socket_server): connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.MultipartHandler, self.DefaultResponseHandler] post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler, self.DeviceManagementHandler] + get_handlers put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + get_handlers
3d6c1e0b70d20e2aad03da624c84efa53f732224 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/3d6c1e0b70d20e2aad03da624c84efa53f732224/testserver.py
if start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src')
elif self.IsMac(): pass 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 be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' os.chdir('..') if start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src')
26dfa7aa33ca867c6a7c6665e3286cb90069ca1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/26dfa7aa33ca867c6a7c6665e3286cb90069ca1b/coverage_posix.py
def __init__(self, filename, file_comment = None): CWriter.__init__(self, filename)
bec520fe8c1d67407f6827f1c5d09e7c7d4b9bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bec520fe8c1d67407f6827f1c5d09e7c7d4b9bd2/build_gles2_cmd_buffer.py
node.attrs['first_id'] = id_list.pop(0)
node.attrs['first_id'] = str(id_list.pop(0))
def AssignFirstIds(self, filename_or_stream, first_id_filename): '''Assign first ids to each grouping node based on values from tools/grit/resource_ids.''' # If the input is a stream, then we're probably in a unit test and # should skip this step. if type(filename_or_stream) not in (str, unicode): return
53bca30ed88fdadd05993ef8e11a88d6376cfd85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/53bca30ed88fdadd05993ef8e11a88d6376cfd85/misc.py
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('Configuring chrome test resources in %s' % top_dir) testsrc_dir = top_dir + '/test_src' utils.run('cp -ral %s %s' % (chrome_test_files, testsrc_dir))
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-chrome' logging.info('Configuring chrome test resources in %s' % top_dir) testsrc_dir = top_dir + '/test_src' # Copy test build outputs. utils.run('cp -ral %s %s' % (chrome_test_files, testsrc_dir))
ec0b7e5672fdfee40f84a25bd56d5dcc5d49a068 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ec0b7e5672fdfee40f84a25bd56d5dcc5d49a068/chrome_test.py
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-chrome' logging.info('Configuring chrome test resources in %s' % top_dir) testsrc_dir = top_dir + '/test_src' # Copy test build outputs. utils.run('cp -ral %s %s' % (chrome_test_files, testsrc_dir))
ec0b7e5672fdfee40f84a25bd56d5dcc5d49a068 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ec0b7e5672fdfee40f84a25bd56d5dcc5d49a068/chrome_test.py
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.
61a8f7df1ad40e0e3595d5c71639da22b266ce2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/61a8f7df1ad40e0e3595d5c71639da22b266ce2d/pyauto.py
def ParseDir(path): """Examine a third_party/foo component and extract its metadata.""" # Try to find README.chromium. readme_path = os.path.join(path, 'README.chromium') if not os.path.exists(readme_path): raise LicenseError("missing README.chromium") # Parse metadata fields out of README.chromium. # We provide a default value of "LICENSE" for the license file. metadata = { "License File": "LICENSE", # Relative path to license text. "Name": None, # Short name (for header on about:credits). "URL": None, # Project home page. } for line in open(readme_path): line = line.strip() for key in metadata.keys(): field = key + ": " if line.startswith(field): metadata[key] = line[len(field):] # Check that all expected metadata is present. for key, value in metadata.iteritems(): if not value: raise LicenseError("couldn't find '" + key + "' line " "in README.chromium") # Check that the license file exists. license_file = metadata["License File"] license_path = os.path.join(path, license_file) if not os.path.exists(license_path): raise LicenseError("License file '" + license_file + "' doesn't exist. " "Either add a 'License File:' section to " "README.chromium or add the missing file.") return metadata
9d61b0d2232bfecdd693dc18aae58f3e81c08d8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9d61b0d2232bfecdd693dc18aae58f3e81c08d8e/licenses.py
license_file = metadata["License File"] license_path = os.path.join(path, license_file) if not os.path.exists(license_path): raise LicenseError("License file '" + license_file + "' doesn't exist. " "Either add a 'License File:' section to " "README.chromium or add the missing file.")
for filename in (metadata["License File"], "COPYING"): license_path = os.path.join(path, filename) if os.path.exists(license_path): metadata["License File"] = filename break license_path = None if not license_path: raise LicenseError("License file not found. " "Either add a file named LICENSE, " "import upstream's COPYING if available, " "or add a 'License File:' line to README.chromium " "with the appropriate path.")
def ParseDir(path): """Examine a third_party/foo component and extract its metadata.""" # Try to find README.chromium. readme_path = os.path.join(path, 'README.chromium') if not os.path.exists(readme_path): raise LicenseError("missing README.chromium") # Parse metadata fields out of README.chromium. # We provide a default value of "LICENSE" for the license file. metadata = { "License File": "LICENSE", # Relative path to license text. "Name": None, # Short name (for header on about:credits). "URL": None, # Project home page. } for line in open(readme_path): line = line.strip() for key in metadata.keys(): field = key + ": " if line.startswith(field): metadata[key] = line[len(field):] # Check that all expected metadata is present. for key, value in metadata.iteritems(): if not value: raise LicenseError("couldn't find '" + key + "' line " "in README.chromium") # Check that the license file exists. license_file = metadata["License File"] license_path = os.path.join(path, license_file) if not os.path.exists(license_path): raise LicenseError("License file '" + license_file + "' doesn't exist. " "Either add a 'License File:' section to " "README.chromium or add the missing file.") return metadata
9d61b0d2232bfecdd693dc18aae58f3e81c08d8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9d61b0d2232bfecdd693dc18aae58f3e81c08d8e/licenses.py
skip_dirs = ('.svn', '.git', 'out', 'Debug', 'Release', 'layout_tests')
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" skip_dirs = ('.svn', '.git', # VCS metadata 'out', 'Debug', 'Release', # build files 'layout_tests') # lots of subdirs third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] # Pretty up the path. # Prune out directories we want to skip. for skip in skip_dirs: if skip in dirs: dirs.remove(skip) if os.path.basename(path) == 'third_party': third_party_dirs.extend([os.path.join(path, dir) for dir in dirs]) # Don't recurse into any subdirs from here. dirs[:] = [] continue return third_party_dirs
9d61b0d2232bfecdd693dc18aae58f3e81c08d8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9d61b0d2232bfecdd693dc18aae58f3e81c08d8e/licenses.py
for skip in skip_dirs:
for skip in PRUNE_DIRS:
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" skip_dirs = ('.svn', '.git', # VCS metadata 'out', 'Debug', 'Release', # build files 'layout_tests') # lots of subdirs third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] # Pretty up the path. # Prune out directories we want to skip. for skip in skip_dirs: if skip in dirs: dirs.remove(skip) if os.path.basename(path) == 'third_party': third_party_dirs.extend([os.path.join(path, dir) for dir in dirs]) # Don't recurse into any subdirs from here. dirs[:] = [] continue return third_party_dirs
9d61b0d2232bfecdd693dc18aae58f3e81c08d8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9d61b0d2232bfecdd693dc18aae58f3e81c08d8e/licenses.py
third_party_dirs.extend([os.path.join(path, dir) for dir in dirs])
for dir in dirs: dirpath = os.path.join(path, dir) if dirpath not in PRUNE_PATHS: third_party_dirs.append(dirpath)
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" skip_dirs = ('.svn', '.git', # VCS metadata 'out', 'Debug', 'Release', # build files 'layout_tests') # lots of subdirs third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] # Pretty up the path. # Prune out directories we want to skip. for skip in skip_dirs: if skip in dirs: dirs.remove(skip) if os.path.basename(path) == 'third_party': third_party_dirs.extend([os.path.join(path, dir) for dir in dirs]) # Don't recurse into any subdirs from here. dirs[:] = [] continue return third_party_dirs
9d61b0d2232bfecdd693dc18aae58f3e81c08d8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9d61b0d2232bfecdd693dc18aae58f3e81c08d8e/licenses.py
""" /* Copyright (c) 2010 The Chromium Authors. All rights reserved.
"""/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
def WriteLines(filename, lines): outfile = open(filename, 'w') for line in lines: outfile.write(line) outfile.write('\n')
103d37f9fc371b91eea4e911da3a585056bbb52c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/103d37f9fc371b91eea4e911da3a585056bbb52c/generate_ppapi_include_tests.py
""" // Copyright (c) 2010 The Chromium Authors. All rights reserved.
"""// Copyright (c) 2010 The Chromium Authors. All rights reserved.
def WriteLines(filename, lines): outfile = open(filename, 'w') for line in lines: outfile.write(line) outfile.write('\n')
103d37f9fc371b91eea4e911da3a585056bbb52c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/103d37f9fc371b91eea4e911da3a585056bbb52c/generate_ppapi_include_tests.py
def GetSourcesForTarget(target_name, gyp_file_data): for target in gyp_file_data[GYP_TARGETS_KEY]: if target[GYP_TARGET_NAME_KEY] == target_name: sources = target[GYP_SOURCES_KEY] sources.sort() return sources print 'Warning: no target named ', target, ' found.' return []
103d37f9fc371b91eea4e911da3a585056bbb52c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/103d37f9fc371b91eea4e911da3a585056bbb52c/generate_ppapi_include_tests.py
WriteLines('tests/test_c_includes.c', lines)
lines.append('\n WriteLines('tests/all_c_includes.h', lines)
def GenerateCIncludeTest(gyp_file_data): c_sources = GetSourcesForTarget('ppapi_c', gyp_file_data) lines = [COPYRIGHT_STRING_C] for source in c_sources: lines.append('#include "ppapi/' + source + '"\n') WriteLines('tests/test_c_includes.c', lines)
103d37f9fc371b91eea4e911da3a585056bbb52c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/103d37f9fc371b91eea4e911da3a585056bbb52c/generate_ppapi_include_tests.py
def GenerateCIncludeTest(gyp_file_data): c_sources = GetSourcesForTarget('ppapi_c', gyp_file_data) lines = [COPYRIGHT_STRING_C] for source in c_sources: lines.append('#include "ppapi/' + source + '"\n') WriteLines('tests/test_c_includes.c', lines)
103d37f9fc371b91eea4e911da3a585056bbb52c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/103d37f9fc371b91eea4e911da3a585056bbb52c/generate_ppapi_include_tests.py
WriteLines('tests/test_cc_includes.cc', lines)
lines.append('\n WriteLines('tests/all_cpp_includes.h', lines)
def GenerateCCIncludeTest(gyp_file_data): cc_sources = GetSourcesForTarget('ppapi_cpp_objects', gyp_file_data) header_re = re.compile('.+\.h$') lines = [COPYRIGHT_STRING_CC] for source in cc_sources: if header_re.match(source): lines.append('#include "ppapi/' + source + '"\n') WriteLines('tests/test_cc_includes.cc', lines)
103d37f9fc371b91eea4e911da3a585056bbb52c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/103d37f9fc371b91eea4e911da3a585056bbb52c/generate_ppapi_include_tests.py
PermanentItem('google_chrome_sessions', name='Sessions', parent_tag='google_chrome', sync_type=SESSION),
def __init__(self, tag, name, parent_tag, sync_type): self.tag = tag self.name = name self.parent_tag = parent_tag self.sync_type = sync_type
72056dfd3beee98a65b3aeac4062b5bffb52df3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/72056dfd3beee98a65b3aeac4062b5bffb52df3c/chromiumsync.py
from pyautolib import *
import pyautolib
def _LocateBinDirs(): 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.path.join(chrome_src, 'out', 'Release'), os.path.join(chrome_src, 'sconsbuild', 'Release')], 'darwin': [ os.path.join(chrome_src, 'xcodebuild', 'Debug'), os.path.join(chrome_src, 'xcodebuild', 'Release')], 'win32': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], 'cygwin': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], } sys.path += bin_dirs.get(sys.platform, [])
16e4b90d3594ab33ede7dc98616af3af2f6797e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/16e4b90d3594ab33ede7dc98616af3af2f6797e0/pyauto.py
class PyUITest(PyUITestSuite, unittest.TestCase):
class PyUITest(pyautolib.PyUITestSuite, unittest.TestCase):
def _LocateBinDirs(): 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.path.join(chrome_src, 'out', 'Release'), os.path.join(chrome_src, 'sconsbuild', 'Release')], 'darwin': [ os.path.join(chrome_src, 'xcodebuild', 'Debug'), os.path.join(chrome_src, 'xcodebuild', 'Release')], 'win32': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], 'cygwin': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], } sys.path += bin_dirs.get(sys.platform, [])
16e4b90d3594ab33ede7dc98616af3af2f6797e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/16e4b90d3594ab33ede7dc98616af3af2f6797e0/pyauto.py
PyUITestSuite.__init__(self, sys.argv)
pyautolib.PyUITestSuite.__init__(self, sys.argv) browser_dir = os.path.normpath(os.path.dirname(pyautolib.__file__)) os.environ['PATH'] = browser_dir + os.pathsep + os.environ['PATH'] self.Initialize(pyautolib.FilePath(browser_dir))
def __init__(self, methodName='runTest'): PyUITestSuite.__init__(self, sys.argv) unittest.TestCase.__init__(self, methodName)
16e4b90d3594ab33ede7dc98616af3af2f6797e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/16e4b90d3594ab33ede7dc98616af3af2f6797e0/pyauto.py
PyUITestSuite.__del__(self)
pyautolib.PyUITestSuite.__del__(self)
def __del__(self): PyUITestSuite.__del__(self)
16e4b90d3594ab33ede7dc98616af3af2f6797e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/16e4b90d3594ab33ede7dc98616af3af2f6797e0/pyauto.py
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 = []
850534ab2821c8ce7c927eb5074c2628bc2b9a9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/850534ab2821c8ce7c927eb5074c2628bc2b9a9c/image_diff.py
def __init__(self, methodName='runTest', extra_chrome_flags=None):
def __init__(self, methodName='runTest', **kwargs):
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
1c7ab112b8fd89fc71616f789ad0474489b02d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1c7ab112b8fd89fc71616f789ad0474489b02d18/pyauto.py
extra_chrome_flags: additional flags to pass when launching chrome
(The rest of the args can be in any order. They can even be skipped in which case the defaults will be used.) extra_chrome_flags: additional flags to pass when launching chrome. Defaults to None clear_profile: If True, clean the profile dir before use. Defaults to True homepage: the home page. Defaults to "about:blank"
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
1c7ab112b8fd89fc71616f789ad0474489b02d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1c7ab112b8fd89fc71616f789ad0474489b02d18/pyauto.py
if extra_chrome_flags is not None:
if extra_chrome_flags:
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
1c7ab112b8fd89fc71616f789ad0474489b02d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1c7ab112b8fd89fc71616f789ad0474489b02d18/pyauto.py
pyautolib.PyUITestSuite.__init__(self, args)
pyautolib.PyUITestSuite.__init__(self, args, clear_profile, homepage)
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest.
1c7ab112b8fd89fc71616f789ad0474489b02d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1c7ab112b8fd89fc71616f789ad0474489b02d18/pyauto.py
def GenerateHeader(file, functions, setName):
def GenerateHeader(file, functions, set_name):
def GenerateHeader(file, functions, setName): """Generates gl_binding_autogen_x.h""" # Write file header. file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#ifndef APP_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % setName.upper()) file.write('#define APP_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % setName.upper()) # Write prototype for initialization function. file.write('\n') file.write('namespace gfx {\n') file.write('\n') file.write('void InitializeGLBindings%s();\n' % setName.upper()) # Write typedefs for function pointer types. Always use the GL name for the # typedef. file.write('\n') for [returnType, names, arguments] in functions: file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' % (returnType, names[0], arguments)) # Write declarations for function pointers. Always use the GL name for the # declaration. file.write('\n') for [returnType, names, arguments] in functions: file.write('extern %sProc g_%s;\n' % (names[0], names[0])) file.write('\n') file.write( '} // namespace gfx\n') # Write macros to invoke function pointers. Always use the GL name for the # macro. file.write('\n') for [returnType, names, arguments] in functions: file.write('#define %s ::gfx::g_%s\n' % (names[0], names[0])) file.write('\n') file.write('#endif // APP_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % setName.upper())
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
file.write(' file.write('
file.write(' file.write('
file.write('#ifndef APP_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % setName.upper())
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
file.write('void InitializeGLBindings%s();\n' % setName.upper())
file.write('void InitializeGLBindings%s();\n' % set_name.upper()) file.write('void InitializeDebugGLBindings%s();\n' % set_name.upper())
file.write('#ifndef APP_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % setName.upper())
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
for [returnType, names, arguments] in functions:
for [return_type, names, arguments] in functions:
file.write('#ifndef APP_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % setName.upper())
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
(returnType, names[0], arguments))
(return_type, names[0], arguments))
file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' % (returnType, names[0], arguments))
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
for [returnType, names, arguments] in functions:
for [return_type, names, arguments] in functions:
file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' % (returnType, names[0], arguments))
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
for [returnType, names, arguments] in functions:
for [return_type, names, arguments] in functions:
file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' % (returnType, names[0], arguments))
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
setName.upper()) def GenerateSource(file, functions, setName):
set_name.upper()) def GenerateSource(file, functions, set_name):
file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' % (returnType, names[0], arguments))
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
for [returnType, names, arguments] in functions:
for [return_type, names, arguments] in functions:
def GenerateSource(file, functions, setName): """Generates gl_binding_autogen_x.cc""" # Write file header. file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include "app/gfx/gl/gl_bindings.h"\n') file.write('#include "app/gfx/gl/gl_implementation.h"\n') # Write definitions of function pointers. file.write('\n') file.write('namespace gfx {\n') file.write('\n') for [returnType, names, arguments] in functions: file.write('%sProc g_%s;\n' % (names[0], names[0])) # Write function to initialize the function pointers. file.write('\n') file.write('void InitializeGLBindings%s() {\n' % setName.upper()) for [returnType, names, arguments] in functions: for name in names: file.write(' if (!g_%s)\n' % names[0]) file.write( ' g_%s = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' % (names[0], names[0], name)) file.write('}\n') file.write('\n') file.write( '} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
file.write('void InitializeGLBindings%s() {\n' % setName.upper()) for [returnType, names, arguments] in functions:
file.write('void InitializeGLBindings%s() {\n' % set_name.upper()) for [return_type, names, arguments] in functions:
def GenerateSource(file, functions, setName): """Generates gl_binding_autogen_x.cc""" # Write file header. file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include "app/gfx/gl/gl_bindings.h"\n') file.write('#include "app/gfx/gl/gl_implementation.h"\n') # Write definitions of function pointers. file.write('\n') file.write('namespace gfx {\n') file.write('\n') for [returnType, names, arguments] in functions: file.write('%sProc g_%s;\n' % (names[0], names[0])) # Write function to initialize the function pointers. file.write('\n') file.write('void InitializeGLBindings%s() {\n' % setName.upper()) for [returnType, names, arguments] in functions: for name in names: file.write(' if (!g_%s)\n' % names[0]) file.write( ' g_%s = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' % (names[0], names[0], name)) file.write('}\n') file.write('\n') file.write( '} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
for [returnType, names, arguments] in functions:
for [return_type, names, arguments] in functions:
def GenerateMockSource(file, functions): """Generates functions that invoke a mock GLInterface""" file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include <string.h>\n') file.write('\n') file.write('#include "app/gfx/gl/gl_interface.h"\n') file.write('\n') file.write('namespace gfx {\n') # Write function that trampoline into the GLInterface. for [returnType, names, arguments] in functions: file.write('\n') file.write('%s GL_BINDING_CALL Mock_%s(%s) {\n' % (returnType, names[0], arguments)) argumentNames = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2', arguments) if argumentNames == 'void': argumentNames = '' functionName = names[0][2:] if returnType == 'void': file.write(' GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) else: file.write(' return GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) file.write('}\n') # Write a function to lookup a mock GL function based on its name. file.write('\n') file.write('void* GL_BINDING_CALL GetMockGLProcAddress(const char* name) {\n') for [returnType, names, arguments] in functions: file.write(' if (strcmp(name, "%s") == 0)\n' % names[0]) file.write(' return reinterpret_cast<void*>(Mock_%s);\n' % names[0]) file.write(' return NULL;\n') file.write('}\n'); file.write('\n') file.write('} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
(returnType, names[0], arguments)) argumentNames = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2',
(return_type, names[0], arguments)) argument_names = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2',
def GenerateMockSource(file, functions): """Generates functions that invoke a mock GLInterface""" file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include <string.h>\n') file.write('\n') file.write('#include "app/gfx/gl/gl_interface.h"\n') file.write('\n') file.write('namespace gfx {\n') # Write function that trampoline into the GLInterface. for [returnType, names, arguments] in functions: file.write('\n') file.write('%s GL_BINDING_CALL Mock_%s(%s) {\n' % (returnType, names[0], arguments)) argumentNames = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2', arguments) if argumentNames == 'void': argumentNames = '' functionName = names[0][2:] if returnType == 'void': file.write(' GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) else: file.write(' return GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) file.write('}\n') # Write a function to lookup a mock GL function based on its name. file.write('\n') file.write('void* GL_BINDING_CALL GetMockGLProcAddress(const char* name) {\n') for [returnType, names, arguments] in functions: file.write(' if (strcmp(name, "%s") == 0)\n' % names[0]) file.write(' return reinterpret_cast<void*>(Mock_%s);\n' % names[0]) file.write(' return NULL;\n') file.write('}\n'); file.write('\n') file.write('} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
if argumentNames == 'void': argumentNames = '' functionName = names[0][2:] if returnType == 'void':
if argument_names == 'void': argument_names = '' function_name = names[0][2:] if return_type == 'void':
def GenerateMockSource(file, functions): """Generates functions that invoke a mock GLInterface""" file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include <string.h>\n') file.write('\n') file.write('#include "app/gfx/gl/gl_interface.h"\n') file.write('\n') file.write('namespace gfx {\n') # Write function that trampoline into the GLInterface. for [returnType, names, arguments] in functions: file.write('\n') file.write('%s GL_BINDING_CALL Mock_%s(%s) {\n' % (returnType, names[0], arguments)) argumentNames = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2', arguments) if argumentNames == 'void': argumentNames = '' functionName = names[0][2:] if returnType == 'void': file.write(' GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) else: file.write(' return GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) file.write('}\n') # Write a function to lookup a mock GL function based on its name. file.write('\n') file.write('void* GL_BINDING_CALL GetMockGLProcAddress(const char* name) {\n') for [returnType, names, arguments] in functions: file.write(' if (strcmp(name, "%s") == 0)\n' % names[0]) file.write(' return reinterpret_cast<void*>(Mock_%s);\n' % names[0]) file.write(' return NULL;\n') file.write('}\n'); file.write('\n') file.write('} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
(functionName, argumentNames))
(function_name, argument_names))
def GenerateMockSource(file, functions): """Generates functions that invoke a mock GLInterface""" file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include <string.h>\n') file.write('\n') file.write('#include "app/gfx/gl/gl_interface.h"\n') file.write('\n') file.write('namespace gfx {\n') # Write function that trampoline into the GLInterface. for [returnType, names, arguments] in functions: file.write('\n') file.write('%s GL_BINDING_CALL Mock_%s(%s) {\n' % (returnType, names[0], arguments)) argumentNames = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2', arguments) if argumentNames == 'void': argumentNames = '' functionName = names[0][2:] if returnType == 'void': file.write(' GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) else: file.write(' return GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) file.write('}\n') # Write a function to lookup a mock GL function based on its name. file.write('\n') file.write('void* GL_BINDING_CALL GetMockGLProcAddress(const char* name) {\n') for [returnType, names, arguments] in functions: file.write(' if (strcmp(name, "%s") == 0)\n' % names[0]) file.write(' return reinterpret_cast<void*>(Mock_%s);\n' % names[0]) file.write(' return NULL;\n') file.write('}\n'); file.write('\n') file.write('} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
(functionName, argumentNames))
(function_name, argument_names))
def GenerateMockSource(file, functions): """Generates functions that invoke a mock GLInterface""" file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include <string.h>\n') file.write('\n') file.write('#include "app/gfx/gl/gl_interface.h"\n') file.write('\n') file.write('namespace gfx {\n') # Write function that trampoline into the GLInterface. for [returnType, names, arguments] in functions: file.write('\n') file.write('%s GL_BINDING_CALL Mock_%s(%s) {\n' % (returnType, names[0], arguments)) argumentNames = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2', arguments) if argumentNames == 'void': argumentNames = '' functionName = names[0][2:] if returnType == 'void': file.write(' GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) else: file.write(' return GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) file.write('}\n') # Write a function to lookup a mock GL function based on its name. file.write('\n') file.write('void* GL_BINDING_CALL GetMockGLProcAddress(const char* name) {\n') for [returnType, names, arguments] in functions: file.write(' if (strcmp(name, "%s") == 0)\n' % names[0]) file.write(' return reinterpret_cast<void*>(Mock_%s);\n' % names[0]) file.write(' return NULL;\n') file.write('}\n'); file.write('\n') file.write('} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
for [returnType, names, arguments] in functions:
for [return_type, names, arguments] in functions:
def GenerateMockSource(file, functions): """Generates functions that invoke a mock GLInterface""" file.write('// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n') file.write('// Use of this source code is governed by a BSD-style license that can be\n') file.write('// found in the LICENSE file.\n') file.write('\n') file.write('// This file is automatically generated.\n') file.write('\n') file.write('#include <string.h>\n') file.write('\n') file.write('#include "app/gfx/gl/gl_interface.h"\n') file.write('\n') file.write('namespace gfx {\n') # Write function that trampoline into the GLInterface. for [returnType, names, arguments] in functions: file.write('\n') file.write('%s GL_BINDING_CALL Mock_%s(%s) {\n' % (returnType, names[0], arguments)) argumentNames = re.sub(r'(const )?[a-zA-Z0-9]+\** ([a-zA-Z0-9]+)', r'\2', arguments) if argumentNames == 'void': argumentNames = '' functionName = names[0][2:] if returnType == 'void': file.write(' GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) else: file.write(' return GLInterface::GetGLInterface()->%s(%s);\n' % (functionName, argumentNames)) file.write('}\n') # Write a function to lookup a mock GL function based on its name. file.write('\n') file.write('void* GL_BINDING_CALL GetMockGLProcAddress(const char* name) {\n') for [returnType, names, arguments] in functions: file.write(' if (strcmp(name, "%s") == 0)\n' % names[0]) file.write(' return reinterpret_cast<void*>(Mock_%s);\n' % names[0]) file.write(' return NULL;\n') file.write('}\n'); file.write('\n') file.write('} // namespace gfx\n')
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
for [functions, setName] in FUNCTION_SETS: headerFile = open( os.path.join(dir, 'gl_bindings_autogen_%s.h' % setName), 'wb') GenerateHeader(headerFile, functions, setName) headerFile.close() sourceFile = open( os.path.join(dir, 'gl_bindings_autogen_%s.cc' % setName), 'wb') GenerateSource(sourceFile, functions, setName) sourceFile.close() sourceFile = open(os.path.join(dir, 'gl_bindings_autogen_mock.cc'), 'wb') GenerateMockSource(sourceFile, GL_FUNCTIONS) sourceFile.close()
for [functions, set_name] in FUNCTION_SETS: header_file = open( os.path.join(dir, 'gl_bindings_autogen_%s.h' % set_name), 'wb') GenerateHeader(header_file, functions, set_name) header_file.close() source_file = open( os.path.join(dir, 'gl_bindings_autogen_%s.cc' % set_name), 'wb') GenerateSource(source_file, functions, set_name) source_file.close() source_file = open(os.path.join(dir, 'gl_bindings_autogen_mock.cc'), 'wb') GenerateMockSource(source_file, GL_FUNCTIONS) source_file.close()
def main(argv): """This is the main function.""" if len(argv) >= 1: dir = argv[0] else: dir = '.' for [functions, setName] in FUNCTION_SETS: headerFile = open( os.path.join(dir, 'gl_bindings_autogen_%s.h' % setName), 'wb') GenerateHeader(headerFile, functions, setName) headerFile.close() sourceFile = open( os.path.join(dir, 'gl_bindings_autogen_%s.cc' % setName), 'wb') GenerateSource(sourceFile, functions, setName) sourceFile.close() sourceFile = open(os.path.join(dir, 'gl_bindings_autogen_mock.cc'), 'wb') GenerateMockSource(sourceFile, GL_FUNCTIONS) sourceFile.close()
41b13474f628e124e24db208e67a4b0ebf16f001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/41b13474f628e124e24db208e67a4b0ebf16f001/generate_bindings.py
'name': func.name, 'arg_index': arg_index, 'value_index': value_index, 'gl_func_name': gl_func_name, 'args': ", ".join(arg_strings), 'all_but_last_args': ", ".join(arg_strings[:-1]), 'gl_args': ", ".join(gl_arg_strings), 'parse_result': parse_result,
'test_name': 'GLES2DecoderTest%d' % file.file_num , 'name': func.name, 'arg_index': arg_index, 'value_index': value_index, 'gl_func_name': gl_func_name, 'args': ", ".join(arg_strings), 'all_but_last_args': ", ".join(arg_strings[:-1]), 'gl_args': ", ".join(gl_arg_strings), 'parse_result': parse_result,
def WriteInvalidUnitTest(self, func, file, test, extra = {}): """Writes a invalid unit test.""" arg_index = 0 for arg in func.GetOriginalArgs(): num_invalid_values = arg.GetNumInvalidValues() for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" count = 0 for arg in func.GetOriginalArgs(): if count == arg_index: (arg_string, parse_result) = arg.GetInvalidArg(count, value_index) else: arg_string = arg.GetValidArg(count, 0) arg_strings.append(arg_string) count += 1 gl_arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): gl_arg_strings.append("_") count += 1 gl_func_name = func.GetGLTestFunctionName() vars = { 'name': func.name, 'arg_index': arg_index, 'value_index': value_index, 'gl_func_name': gl_func_name, 'args': ", ".join(arg_strings), 'all_but_last_args': ", ".join(arg_strings[:-1]), 'gl_args': ", ".join(gl_arg_strings), 'parse_result': parse_result, } vars.update(extra) file.Write(test % vars) arg_index += 1
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) return
def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) return valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) return valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) return valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) {
TEST_F(%(test_name)s, %(name)sInvalidArgs) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) {
TEST_F(%(test_name)s, %(name)sInvalidArgs) {
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) {
TEST_F(%(test_name)s, %(name)sInvalidArgs) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) {
TEST_F(%(test_name)s, %(name)sInvalidArgs) {
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sValidArgs) {
TEST_F(%(test_name)s, %(name)sValidArgs) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
file.Write(" if (!id_manager_->GetServiceId(c.%s, &%s)) {\n" %
file.Write(" if (!id_manager()->GetServiceId(c.%s, &%s)) {\n" %
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")
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
def __init__(self, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args):
def __init__(self, original_name, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args):
def __init__(self, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_args = num_pointer_args self.can_auto_generate = num_pointer_args == 0 and return_type == "void" self.cmd_args = cmd_args self.init_args = init_args self.args_for_cmds = args_for_cmds self.type_handler.InitFunction(self)
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
self.original_name = name
self.original_name = original_name
def __init__(self, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_args = num_pointer_args self.can_auto_generate = num_pointer_args == 0 and return_type == "void" self.cmd_args = cmd_args self.init_args = init_args self.args_for_cmds = args_for_cmds self.type_handler.InitFunction(self)
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
if self.GetInfo('DecoderFunc'): return self.GetInfo('DecoderFunc')
if self.GetInfo('decoder_func'): return self.GetInfo('decoder_func')
def GetGLFunctionName(self): """Gets the function to call to execute GL for this command.""" if self.GetInfo('DecoderFunc'): return self.GetInfo('DecoderFunc') return "gl%s" % self.original_name
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
gl_func_name = self.name
gl_func_name = self.original_name
def GetGLTestFunctionName(self): gl_func_name = self.GetInfo('gl_test_func') if gl_func_name == None: gl_func_name = self.GetGLFunctionName() if gl_func_name.startswith("gl"): gl_func_name = gl_func_name[2:] else: gl_func_name = self.name return gl_func_name
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
self.original_name = func.name
def __init__(self, func): new_args = [] for arg in func.GetOriginalArgs(): new_arg = arg.GetImmediateVersion() if new_arg: new_args.append(new_arg)
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
f = Function(func_name, func_info, return_type, args, args_for_cmds, cmd_args, init_args, num_pointer_args)
f = Function(func_name, func_name, func_info, return_type, args, args_for_cmds, cmd_args, init_args, num_pointer_args)
def ParseGLH(self, filename): """Parses the GL2.h file and extracts the functions""" for line in _GL_FUNCTIONS.splitlines(): match = self._function_re.match(line) if match: func_name = match.group(2)[2:] func_info = self.GetFunctionInfo(func_name) if func_info.type != 'Noop': return_type = match.group(1).strip() arg_string = match.group(3) (args, num_pointer_args, is_gl_enum) = self.ParseArgs(arg_string) if is_gl_enum: self.Log("%s uses bare GLenum" % func_name) args_for_cmds = args if hasattr(func_info, 'cmd_args'): (args_for_cmds, num_pointer_args, is_gl_enum) = ( self.ParseArgs(getattr(func_info, 'cmd_args'))) cmd_args = [] for arg in args_for_cmds: arg.AddCmdArgs(cmd_args) init_args = [] for arg in args_for_cmds: arg.AddInitArgs(init_args) return_arg = CreateArg(return_type + " result") if return_arg: init_args.append(return_arg) f = Function(func_name, func_info, return_type, args, args_for_cmds, cmd_args, init_args, num_pointer_args) self.original_functions.append(f) self.AddFunction(f) f.type_handler.AddImmediateFunction(self, f)
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
file = CHeaderWriter( filename, "// It is included by gles2_cmd_decoder_unittest.cc\n") for func in self.functions: func.WriteServiceUnitTest(file) file.Close()
num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file) file.Close()
def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" file = CHeaderWriter( filename, "// It is included by gles2_cmd_decoder_unittest.cc\n")
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_autogen.h")
gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h")
def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1)
0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py
def UpdateGClientBranch(webkit_rev):
def UpdateGClientBranch(webkit_rev, magic_gclient_branch):
def UpdateGClientBranch(webkit_rev): """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.name == 'nt')) target = FindSVNRev(webkit_rev) if not target: print "ERROR: Couldn't map r%s to a git revision." % webkit_rev sys.exit(1) current = RunGit(['show-ref', '--hash', MAGIC_GCLIENT_BRANCH]) if current == target: return False # No change necessary. subprocess.check_call(['git', 'update-ref', '-m', 'gclient sync', MAGIC_GCLIENT_BRANCH, target], shell=(os.name == 'nt')) return True
8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0/sync-webkit-git.py
current = RunGit(['show-ref', '--hash', MAGIC_GCLIENT_BRANCH])
current = RunGit(['show-ref', '--hash', magic_gclient_branch])
def UpdateGClientBranch(webkit_rev): """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.name == 'nt')) target = FindSVNRev(webkit_rev) if not target: print "ERROR: Couldn't map r%s to a git revision." % webkit_rev sys.exit(1) current = RunGit(['show-ref', '--hash', MAGIC_GCLIENT_BRANCH]) if current == target: return False # No change necessary. subprocess.check_call(['git', 'update-ref', '-m', 'gclient sync', MAGIC_GCLIENT_BRANCH, target], shell=(os.name == 'nt')) return True
8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0/sync-webkit-git.py
MAGIC_GCLIENT_BRANCH, target],
magic_gclient_branch, target],
def UpdateGClientBranch(webkit_rev): """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.name == 'nt')) target = FindSVNRev(webkit_rev) if not target: print "ERROR: Couldn't map r%s to a git revision." % webkit_rev sys.exit(1) current = RunGit(['show-ref', '--hash', MAGIC_GCLIENT_BRANCH]) if current == target: return False # No change necessary. subprocess.check_call(['git', 'update-ref', '-m', 'gclient sync', MAGIC_GCLIENT_BRANCH, target], shell=(os.name == 'nt')) return True
8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0/sync-webkit-git.py
def UpdateCurrentCheckoutIfAppropriate():
def UpdateCurrentCheckoutIfAppropriate(magic_gclient_branch):
def UpdateCurrentCheckoutIfAppropriate(): """Reset the current gclient branch if that's what we have checked out.""" branch = RunGit(['symbolic-ref', '-q', 'HEAD']) if branch != MAGIC_GCLIENT_BRANCH: print "We have now updated the 'gclient' branch, but third_party/WebKit" print "has some other branch ('%s') checked out." % branch print "Run 'git checkout gclient' under third_party/WebKit if you want" print "to switch it to the version requested by DEPS." return 1 if subprocess.call(['git', 'diff-index', '--exit-code', '--shortstat', 'HEAD'], shell=(os.name == 'nt')): print "Resetting tree state to new revision." subprocess.check_call(['git', 'reset', '--hard'], shell=(os.name == 'nt'))
8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0/sync-webkit-git.py
if branch != MAGIC_GCLIENT_BRANCH:
if branch != magic_gclient_branch:
def UpdateCurrentCheckoutIfAppropriate(): """Reset the current gclient branch if that's what we have checked out.""" branch = RunGit(['symbolic-ref', '-q', 'HEAD']) if branch != MAGIC_GCLIENT_BRANCH: print "We have now updated the 'gclient' branch, but third_party/WebKit" print "has some other branch ('%s') checked out." % branch print "Run 'git checkout gclient' under third_party/WebKit if you want" print "to switch it to the version requested by DEPS." return 1 if subprocess.call(['git', 'diff-index', '--exit-code', '--shortstat', 'HEAD'], shell=(os.name == 'nt')): print "Resetting tree state to new revision." subprocess.check_call(['git', 'reset', '--hard'], shell=(os.name == 'nt'))
8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0/sync-webkit-git.py
changed = UpdateGClientBranch(webkit_rev)
magic_gclient_branch = GetGClientBranchName() changed = UpdateGClientBranch(webkit_rev, magic_gclient_branch)
def main(): if not os.path.exists('third_party/WebKit/.git'): if os.path.exists('third_party/WebKit'): print "ERROR: third_party/WebKit appears to not be under git control." else: print "ERROR: third_party/WebKit could not be found." print "Did you run this script from the right directory?" print "See http://code.google.com/p/chromium/wiki/UsingWebKitGit for" print "setup instructions." return 1 webkit_rev = GetWebKitRev() print 'Desired revision: r%s.' % webkit_rev os.chdir('third_party/WebKit') changed = UpdateGClientBranch(webkit_rev) if changed: return UpdateCurrentCheckoutIfAppropriate() else: print "Already on correct revision." return 0
8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0/sync-webkit-git.py
return UpdateCurrentCheckoutIfAppropriate()
return UpdateCurrentCheckoutIfAppropriate(magic_gclient_branch)
def main(): if not os.path.exists('third_party/WebKit/.git'): if os.path.exists('third_party/WebKit'): print "ERROR: third_party/WebKit appears to not be under git control." else: print "ERROR: third_party/WebKit could not be found." print "Did you run this script from the right directory?" print "See http://code.google.com/p/chromium/wiki/UsingWebKitGit for" print "setup instructions." return 1 webkit_rev = GetWebKitRev() print 'Desired revision: r%s.' % webkit_rev os.chdir('third_party/WebKit') changed = UpdateGClientBranch(webkit_rev) if changed: return UpdateCurrentCheckoutIfAppropriate() else: print "Already on correct revision." return 0
8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a98a7e9ea84cfd8a045ced8dc0dec8c50483fc0/sync-webkit-git.py
def RenderPage(name, test_shell):
def RenderPages(names, test_shell):
def RenderPage(name, test_shell): """ Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html """ if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" # Copy page_shell to destination output and move aside original, if it exists. original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read() os.remove(input_file) shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen([test_shell, "--layout-tests", generator_url], stdout=PIPE) # The remaining output will be the content of the generated page. result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith("#TEST_TIMED_OUT")): raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" # Remove the trailing #EOF that test shell appends to the output. result = result.replace('#EOF', '') # Remove page_shell os.remove(input_file) # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Write output open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html
Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html
def RenderPage(name, test_shell): """ Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html """ if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" # Copy page_shell to destination output and move aside original, if it exists. original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read() os.remove(input_file) shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen([test_shell, "--layout-tests", generator_url], stdout=PIPE) # The remaining output will be the content of the generated page. result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith("#TEST_TIMED_OUT")): raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" # Remove the trailing #EOF that test shell appends to the output. result = result.replace('#EOF', '') # Remove page_shell os.remove(input_file) # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Write output open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read()
if not names: raise Exception("RenderPage called with empty names param") generator_url = "file:" + urllib.pathname2url(_generator_html) generator_url += "?" + ",".join(names) originals = {} for name in names: input_file = _base_dir + "/" + name + ".html" if (os.path.isfile(input_file)): originals[name] = open(input_file, 'rb').read() os.remove(input_file) else: originals[name] = "" shutil.copy(_page_shell_html, input_file) p = Popen( [test_shell, "--layout-tests", "--time-out-ms=30000", generator_url], stdout=PIPE) output = p.stdout.read() begin = output.find(_expected_output_preamble) end = output.rfind(_expected_output_postamble) if (begin < 0 or end < 0): raise Exception ("test_shell returned invalid output:\n\n" + output) begin += len(_expected_output_preamble) try: output_parsed = json.loads(output[begin:end]) except ValueError, msg: raise Exception("Could not parse test_shell output as JSON. Error: " + msg + "\n\nOutput was:\n" + output) changed_files = [] for name in names: result = output_parsed[name].encode("utf8") + '\n' result = result.replace('\r', '') input_file = _base_dir + "/" + name + ".html"
def RenderPage(name, test_shell): """ Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html """ if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" # Copy page_shell to destination output and move aside original, if it exists. original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read() os.remove(input_file) shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen([test_shell, "--layout-tests", generator_url], stdout=PIPE) # The remaining output will be the content of the generated page. result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith("#TEST_TIMED_OUT")): raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" # Remove the trailing #EOF that test shell appends to the output. result = result.replace('#EOF', '') # Remove page_shell os.remove(input_file) # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Write output open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
shutil.copy(_page_shell_html, input_file) p = Popen([test_shell, "--layout-tests", generator_url], stdout=PIPE) result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith(" raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" result = result.replace(' os.remove(input_file) result = result.replace('\r', '') open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file
open(input_file, 'wb').write(result) if (originals[name] and result != originals[name]): changed_files.append(input_file) return changed_files
def RenderPage(name, test_shell): """ Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html """ if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" # Copy page_shell to destination output and move aside original, if it exists. original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read() os.remove(input_file) shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen([test_shell, "--layout-tests", generator_url], stdout=PIPE) # The remaining output will be the content of the generated page. result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith("#TEST_TIMED_OUT")): raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" # Remove the trailing #EOF that test shell appends to the output. result = result.replace('#EOF', '') # Remove page_shell os.remove(input_file) # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Write output open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
search_locations.append(chrome_dir + "/Release/test_shell.exe")
def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception ("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path")
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell")
def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception ("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path")
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell")
def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception ("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path")
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
raise Exception ("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path")
raise Exception("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path")
def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception ("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path")
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
modified_files = [] for page in page_names: modified_file = RenderPage(page, test_shell) if (modified_file): modified_files.append(modified_file)
modified_files = RenderPages(page_names, test_shell)
def main(): # Prevent windows from using cygwin python. if (sys.platform == "cygwin"): raise Exception("Building docs not supported for cygwin python.\n" "Please run the build.bat script.") parser = OptionParser() parser.add_option("--test-shell-path", dest="test_shell_path") (options, args) = parser.parse_args() if (options.test_shell_path and os.path.isfile(options.test_shell_path)): test_shell = options.test_shell_path else: test_shell = FindTestShell() # Read static file names static_names = GetStaticFileNames() # Read module names module_names = GetAPIModuleNames() # All pages to generate page_names = static_names | module_names modified_files = [] for page in page_names: modified_file = RenderPage(page, test_shell) if (modified_file): modified_files.append(modified_file) if (len(modified_files) == 0): print "Output files match existing files. No changes made." else: print ("ATTENTION: EXTENSION DOCS HAVE CHANGED\n" + "The following files have been modified and should be checked\n" + "into source control (ideally in the same changelist as the\n" + "underlying files that resulting in their changing).") for f in modified_files: print f # Hack. Sleep here, otherwise windows doesn't properly close the debug.log # and the os.remove will fail with a "Permission denied". time.sleep(1) debug_log = os.path.normpath(_build_dir + "/" + "debug.log") if (os.path.isfile(debug_log)): os.remove(debug_log) return os.EX_OK
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
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)
6f82ef0f8c10cdd25097e449948ca9c042f3171e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6f82ef0f8c10cdd25097e449948ca9c042f3171e/autofill.py
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 invalid fields. with_invalid = without_invalid.copy() with_invalid['PHONE_HOME_WHOLE_NUMBER'] = 'Invalid_Phone_Number' with_invalid['PHONE_FAX_WHOLE_NUMBER'] = 'Invalid_Fax_Number' self.FillAutoFillProfile(profiles=[with_invalid]) self.assertEqual([without_invalid], self.GetAutoFillProfile()['profiles'])
6f82ef0f8c10cdd25097e449948ca9c042f3171e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6f82ef0f8c10cdd25097e449948ca9c042f3171e/autofill.py
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 invalid fields. with_invalid = without_invalid.copy() with_invalid['PHONE_HOME_WHOLE_NUMBER'] = 'Invalid_Phone_Number' with_invalid['PHONE_FAX_WHOLE_NUMBER'] = 'Invalid_Fax_Number' self.FillAutoFillProfile(profiles=[with_invalid]) self.assertEqual([without_invalid], self.GetAutoFillProfile()['profiles'])
6f82ef0f8c10cdd25097e449948ca9c042f3171e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6f82ef0f8c10cdd25097e449948ca9c042f3171e/autofill.py
if os.path.exists(deps_file):
if os.path.isfile(deps_file):
def Lookup(self, var_name): """Implements the Var syntax.""" if var_name in self._local_scope.get("vars", {}): return self._local_scope["vars"][var_name] raise Error("Var is not defined: %s" % var_name)
f42c7e5c22c625194c1cd4fc70ca350e2d96dd21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f42c7e5c22c625194c1cd4fc70ca350e2d96dd21/checkdeps.py
return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"])
return self.SimpleTest("chrome", "remoting_unittests")
def TestRemoting(self): return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"])
33e152860faa695847e6e9c8c0cf4ea71d6421e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/33e152860faa695847e6e9c8c0cf4ea71d6421e6/chrome_tests.py