bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
476,100
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
476,101
def __init__(self): self.site='UNDEFINED' self.times=[]
def __init__(self): self.site='UNDEFINED' self.times=[]
476,102
def percentile(N, percent, key=lambda x:x): """ Find the percentile of a list of values. @parameter N - is a list of values. Note N MUST BE already sorted. @parameter percent - a float value from 0.0 to 1.0. @parameter key - optional key function to compute value from each element of N. @return - the percentile of the values """ if not N: return None k = (len(N)-1) * percent f = math.floor(k) c = math.ceil(k) if f == c: return key(N[int(k)]) d0 = key(N[int(f)]) * (k-f) d1 = key(N[int(c)]) * (c-k) return d0+d1
def percentile(N, percent, key=lambda x:x): """ Find the percentile of a list of values. class desktopui_PageCyclerTests(test.test): version = 1 results = {} @return - the percentile of the values """ if not N: return None k = (len(N)-1) * percent f = math.floor(k) c = math.ceil(k) if f == c: return key(N[int(k)]) d0 = key(N[int(f)]) * (k-f) d1 = key(N[int(c)]) * (c-k) return d0+d1
476,103
def percentile(N, percent, key=lambda x:x): """ Find the percentile of a list of values. @parameter N - is a list of values. Note N MUST BE already sorted. @parameter percent - a float value from 0.0 to 1.0. @parameter key - optional key function to compute value from each element of N. @return - the percentile of the values """ if not N: return None k = (len(N)-1) * percent f = math.floor(k) c = math.ceil(k) if f == c: return key(N[int(k)]) d0 = key(N[int(f)]) * (k-f) d1 = key(N[int(c)]) * (c-k) return d0+d1
def percentile(N, percent, key=lambda x:x): """ Find the percentile of a list of values. @parameter N - is a list of values. Note N MUST BE already sorted. @parameter percent - a float value from 0.0 to 1.0. @parameter key - optional key function to compute value from each element of N. def run_page_cycler(self, gtest_filter = ''): assert(gtest_filter != ''), gtest_filter+' cannot be empty!' cmd = ('CR_SOURCE_ROOT=/home/chronos/chromium/src /home/chronos/' 'chromium/src/x86-generic_out/Release/page_cycler_tests' ' --gtest_filter=')+gtest_filter xcmd = site_ui.xcommand(cmd) logging.debug('Running: '+gtest_filter) output = utils.system_output(xcmd) pcrp = PageCyclerResultsParser() result = pcrp.parse_results(output) logging.debug(result) self.results[gtest_filter] = result
476,104
def mean(numbers): assert(len(numbers) != 0), 'list should not be empty!' return sum(numbers)/len(numbers)
def mean(numbers): assert(len(numbers) != 0), 'list should not be empty!' return sum(numbers)/len(numbers)
476,105
def WriteGetCode(self, file): """Overridden from Argument.""" code = """ %(type)s %(name)s = c.%(name)s;
def WriteGetCode(self, file): """Overridden from Argument.""" code = """ %(type)s %(name)s = c.%(name)s;
476,106
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if self.resource_type == "Texture": return ("client_buffer_id_", "kNoError", "GL_INVALID_OPERATION") return ("client_texture_id_", "kNoError", "GL_INVALID_OPERATION")
defGetInvalidArg(self,offset,index):"""returnsaninvalidvaluebyindex."""ifself.resource_type=="Texture":return("client_buffer_id_","kNoError","GL_INVALID_OPERATION")return("client_texture_id_","kNoError","GL_INVALID_OPERATION")
476,107
def _ParseArgs(self): parser = optparse.OptionParser() parser.add_option( '-d', '--outdir', type='string', default=None, help='Directory in which to setup. This is typically the directory ' 'where the binaries would go when compiled from source.') parser.add_option( '-p', '--platform', type='string', default=pyauto_utils.GetCurrentPlatform(), help='Platform. Valid options: win, mac, linux32, linux64. ' 'Default: current platform (%s)' % pyauto_utils.GetCurrentPlatform()) self._options, self._args = parser.parse_args() if not self._options.outdir: print >>sys.stderr, 'Need output directory: -d/--outdir' sys.exit(1) if not self._args: print >>sys.stderr, 'Need download url' sys.exit(2) self._outdir = self._options.outdir self._url = self._args[0]
def _ParseArgs(self): parser = optparse.OptionParser() parser.add_option( '-d', '--outdir', type='string', default=None, help='Directory in which to setup. This is typically the directory ' 'where the binaries would go when compiled from source.') parser.add_option( '-p', '--platform', type='string', default=pyauto_utils.GetCurrentPlatform(), help='Platform. Valid options: win, mac, linux32, linux64. ' 'Default: current platform (%s)' % pyauto_utils.GetCurrentPlatform()) self._options, self._args = parser.parse_args() if not self._options.outdir: print >>sys.stderr, 'Need output directory: -d/--outdir' sys.exit(1) if not self._args: print >>sys.stderr, 'Need download url' sys.exit(2) self._outdir = self._options.outdir self._url = self._args[0]
476,108
def _ParseArgs(self): parser = optparse.OptionParser() parser.add_option( '-d', '--outdir', type='string', default=None, help='Directory in which to setup. This is typically the directory ' 'where the binaries would go when compiled from source.') parser.add_option( '-p', '--platform', type='string', default=pyauto_utils.GetCurrentPlatform(), help='Platform. Valid options: win, mac, linux32, linux64. ' 'Default: current platform (%s)' % pyauto_utils.GetCurrentPlatform()) self._options, self._args = parser.parse_args() if not self._options.outdir: print >>sys.stderr, 'Need output directory: -d/--outdir' sys.exit(1) if not self._args: print >>sys.stderr, 'Need download url' sys.exit(2) self._outdir = self._options.outdir self._url = self._args[0]
def _ParseArgs(self): parser = optparse.OptionParser() parser.add_option( '-d', '--outdir', type='string', default=None, help='Directory in which to setup. This is typically the directory ' 'where the binaries would go when compiled from source.') parser.add_option( '-p', '--platform', type='string', default=pyauto_utils.GetCurrentPlatform(), help='Platform. Valid options: win, mac, linux32, linux64. ' 'Default: current platform (%s)' % pyauto_utils.GetCurrentPlatform()) self._options, self._args = parser.parse_args() if not self._options.outdir: print >>sys.stderr, 'Need output directory: -d/--outdir' sys.exit(1) if not self._args: print >>sys.stderr, 'Need download url' sys.exit(2) self._outdir = self._options.outdir self._url = self._args[0]
476,109
def Run(self): self._ParseArgs() if not os.path.isdir(self._outdir): os.makedirs(self._outdir)
def Run(self): self._ParseArgs() if not os.path.isdir(self._outdir): os.makedirs(self._outdir)
476,110
def testPerfExpectations(self): perf_data = LoadData()
def testPerfExpectations(self): perf_data = LoadData()
476,111
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,112
def ParseReportFile(self, filename): self.cur_fd_ = open(filename, 'r')
def ParseReportFile(self, filename): self.cur_fd_ = open(filename, 'r')
476,113
def AddComputedActions(actions): """Add computed actions to the actions list. Arguments: actions: set of actions to add to. """ # Actions for back_forward_menu_model.cc. for dir in ['BackMenu_', 'ForwardMenu_']: actions.add(dir + 'ShowFullHistory') actions.add(dir + 'Popup') for i in range(1, 20): actions.add(dir + 'HistoryClick' + str(i)) actions.add(dir + 'ChapterClick' + str(i)) # Actions for new_tab_ui.cc. for i in range(1, 10): actions.add('MostVisited%d' % i)
def AddComputedActions(actions): """Add computed actions to the actions list. Arguments: actions: set of actions to add to. """ # Actions for back_forward_menu_model.cc. for dir in ('BackMenu_', 'ForwardMenu_'): actions.add(dir + 'ShowFullHistory') actions.add(dir + 'Popup') for i in range(1, 20): actions.add(dir + 'HistoryClick' + str(i)) actions.add(dir + 'ChapterClick' + str(i)) # Actions for new_tab_ui.cc. for i in range(1, 10): actions.add('MostVisited%d' % i)
476,114
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', server_data['port'])) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
476,115
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self.GetNumTests())) except: # Save the exception for our caller to see. self._exception_info = sys.exc_info() self._stop_time = time.time() # Re-raise it and die. logging.error('thread %s dying: %s' % (self.getName(), self._exception_info)) raise self._stop_time = time.time()
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('%s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self.GetNumTests())) except: # Save the exception for our caller to see. self._exception_info = sys.exc_info() self._stop_time = time.time() # Re-raise it and die. logging.error('thread %s dying: %s' % (self.getName(), self._exception_info)) raise self._stop_time = time.time()
476,116
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self.GetNumTests())) except: # Save the exception for our caller to see. self._exception_info = sys.exc_info() self._stop_time = time.time() # Re-raise it and die. logging.error('thread %s dying: %s' % (self.getName(), self._exception_info)) raise self._stop_time = time.time()
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('%s done (%d tests)' % (self.getName(), self.GetNumTests())) except: # Save the exception for our caller to see. self._exception_info = sys.exc_info() self._stop_time = time.time() # Re-raise it and die. logging.error('thread %s dying: %s' % (self.getName(), self._exception_info)) raise self._stop_time = time.time()
476,117
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self.GetNumTests())) except: # Save the exception for our caller to see. self._exception_info = sys.exc_info() self._stop_time = time.time() # Re-raise it and die. logging.error('thread %s dying: %s' % (self.getName(), self._exception_info)) raise self._stop_time = time.time()
def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self.GetNumTests())) except: # Save the exception for our caller to see. self._exception_info = sys.exc_info() self._stop_time = time.time() # Re-raise it and die. logging.error('%s dying: %s' % (self.getName(), self._exception_info)) raise self._stop_time = time.time()
476,118
def _Run(self, test_runner, result_summary): """Main work entry point of the thread. Basically we pull urls from the filename queue and run the tests until we run out of urls.
def _Run(self, test_runner, result_summary): """Main work entry point of the thread. Basically we pull urls from the filename queue and run the tests until we run out of urls.
476,119
def _Run(self, test_runner, result_summary): """Main work entry point of the thread. Basically we pull urls from the filename queue and run the tests until we run out of urls.
def _Run(self, test_runner, result_summary): """Main work entry point of the thread. Basically we pull urls from the filename queue and run the tests until we run out of urls.
476,120
def ExtractModuleName(infile_path): """Infers the module name from the input file path. The input filename is supposed to be in the form "ModuleName.sigs". This function splits the filename from the extention on that basename of the path and returns that as the module name. Args: infile_path: String holding the path to the input file. Returns: The module name as a string. """ basename = os.path.basename(infile_path) # This loop continously removes suffixes of the filename separated by a "." # character. while 1: new_basename = os.path.splitext(basename)[0] if basename == new_basename: break else: basename = new_basename return basename
def ExtractModuleName(infile_path): """Infers the module name from the input file path. The input filename is supposed to be in the form "ModuleName.sigs". This function splits the filename from the extention on that basename of the path and returns that as the module name. Args: infile_path: String holding the path to the input file. Returns: The module name as a string. """ basename = os.path.basename(infile_path) # This loop continously removes suffixes of the filename separated by a "." # character. while 1: new_basename = os.path.splitext(basename)[0] if basename == new_basename: break else: basename = new_basename return basename
476,121
def RewritePath(path, sysroot): """Rewrites a path by prefixing it with the sysroot if it is absolute.""" if os.path.isabs(path) and not path.startswith(sysroot): path = path.lstrip('/') return os.path.join(sysroot, path) else: return path
def RewritePath(path, opts): """Rewrites a path by stripping the prefix and prepending the sysroot.""" sysroot = opts.sysroot prefix = opts.strip_prefix if os.path.isabs(path) and not path.startswith(sysroot): path = path.lstrip('/') return os.path.join(sysroot, path) else: return path
476,122
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = RewritePath(args[i], sysroot) except IndexError: sys.stderr.write('Missing argument following %s\n' % prefix) break elif args[i].startswith(prefix): args[i] = prefix + RewritePath(args[i][len(prefix):], sysroot) i += 1 return ' '.join(args)
def RewriteLine(line, opts): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = RewritePath(args[i], sysroot) except IndexError: sys.stderr.write('Missing argument following %s\n' % prefix) break elif args[i].startswith(prefix): args[i] = prefix + RewritePath(args[i][len(prefix):], sysroot) i += 1 return ' '.join(args)
476,123
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = RewritePath(args[i], sysroot) except IndexError: sys.stderr.write('Missing argument following %s\n' % prefix) break elif args[i].startswith(prefix): args[i] = prefix + RewritePath(args[i][len(prefix):], sysroot) i += 1 return ' '.join(args)
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = RewritePath(args[i], opts) except IndexError: sys.stderr.write('Missing argument following %s\n' % prefix) break elif args[i].startswith(prefix): args[i] = prefix + RewritePath(args[i][len(prefix):], sysroot) i += 1 return ' '.join(args)
476,124
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = RewritePath(args[i], sysroot) except IndexError: sys.stderr.write('Missing argument following %s\n' % prefix) break elif args[i].startswith(prefix): args[i] = prefix + RewritePath(args[i][len(prefix):], sysroot) i += 1 return ' '.join(args)
def RewriteLine(line, sysroot): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix: i += 1 try: args[i] = RewritePath(args[i], sysroot) except IndexError: sys.stderr.write('Missing argument following %s\n' % prefix) break elif args[i].startswith(prefix): args[i] = prefix + RewritePath(args[i][len(prefix):], opts) i += 1 return ' '.join(args)
476,125
def main(argv): try: sysroot = argv[1] except IndexError: sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) return 1 for line in sys.stdin.readlines(): line = RewriteLine(line.strip(), sysroot) print line return 0
def main(argv): parser = optparse.OptionParser() parser.add_option('-s', '--sysroot', default='/', help='sysroot to prepend') parser.add_option('-p', '--strip-prefix', default='', help='prefix to strip') opts, args = parser.parse_args(argv[1:]) for line in sys.stdin.readlines(): line = RewriteLine(line.strip(), sysroot) print line return 0
476,126
def main(argv): try: sysroot = argv[1] except IndexError: sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) return 1 for line in sys.stdin.readlines(): line = RewriteLine(line.strip(), sysroot) print line return 0
def main(argv): try: sysroot = argv[1] except IndexError: sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) return 1 for line in sys.stdin.readlines(): line = RewriteLine(line.strip(), opts) print line return 0
476,127
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
476,128
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
476,129
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, source_file_filter=sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
476,130
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, source_file_filter=text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
476,131
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, source_file_filter=sources)) return results
476,132
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ # We'll be storing the analyzed results of individual tests # in a temporary text file self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1]
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ # We'll be storing the analyzed results of individual tests # in a temporary text file self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1]
476,133
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ # We'll be storing the analyzed results of individual tests # in a temporary text file self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1]
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ # We'll be storing the analyzed results of individual tests # in a temporary text file self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1]
476,134
def __init__(self, methodName='runTest'): pyautolib.PyUITestSuite.__init__(self, sys.argv) # Figure out path to chromium binaries 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)) unittest.TestCase.__init__(self, methodName)
def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest. When redefining __init__ in a derived class, make sure that: o you make a call this __init__ o __init__ takes methodName as a arg. this is mandated by unittest module Args: methodName: the default method name. Internal use by unittest module extra_chrome_flags: additional flags to pass when launching chrome """ args = sys.argv if extra_chrome_flags is not None: args.append('--extra-chrome-flags=%s' % extra_chrome_flags) pyautolib.PyUITestSuite.__init__(self, args) # Figure out path to chromium binaries 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)) unittest.TestCase.__init__(self, methodName)
476,135
def PrepareForTestWine(self): """Set up the Wine environment.
def PrepareForTestWine(self): """Set up the Wine environment.
476,136
def _parse_api_calls(self, api_methods): """ Returns a list of Chrome extension API calls the sample makes.
def _parse_api_calls(self, api_methods): """ Returns a list of Chrome extension API calls the sample makes.
476,137
def _parse_api_calls(self, api_methods): """ Returns a list of Chrome extension API calls the sample makes.
def _parse_api_calls(self, api_methods): """ Returns a list of Chrome extension API calls the sample makes.
476,138
def main(): if not os.path.exists('third_party/WebKit/.git'): print "ERROR: third_party/WebKit appears to not be under git control." print "See http://code.google.com/p/chromium/wiki/UsingWebKitGit for" print "setup instructions." return webkit_rev = GetWebKitRev() print 'Desired revision: r%s.' % webkit_rev os.chdir('third_party/WebKit') changed = UpdateGClientBranch(webkit_rev) if changed: UpdateCurrentCheckoutIfAppropriate() else: print "Already on correct revision."
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 webkit_rev = GetWebKitRev() print 'Desired revision: r%s.' % webkit_rev os.chdir('third_party/WebKit') changed = UpdateGClientBranch(webkit_rev) if changed: UpdateCurrentCheckoutIfAppropriate() else: print "Already on correct revision."
476,139
def testPDFRunner(self): """Navigate to pdf files and verify that browser doesn't crash""" # bail out if not a branded build properties = self.GetBrowserInfo()['properties'] if properties['branding'] != 'Google Chrome': return pdf_files_path = os.path.join(self.DataDir(), 'plugin', 'pdf') pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf')) for pdf_file in pdf_files: # Some pdfs cause known crashes. Exclude them. crbug.com/63549 if os.path.basename(pdf_file) in ('nullip.pdf', 'sample.pdf'): continue url = self.GetFileURLForPath(os.path.join(pdf_files_path, pdf_file)) self.AppendTab(pyauto.GURL(url)) for tab_index in range(1, len(pdf_files) + 1): self.ActivateTab(tab_index) self._PerformPDFAction('fitToHeight', tab_index=tab_index) self._PerformPDFAction('fitToWidth', tab_index=tab_index) # Assert that there is at least 1 browser window. self.assertTrue(self.GetBrowserWindowCount(), 'Browser crashed, no window is open')
def testPDFRunner(self): """Navigate to pdf files and verify that browser doesn't crash""" # bail out if not a branded build properties = self.GetBrowserInfo()['properties'] if properties['branding'] != 'Google Chrome': return pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf') pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf')) for pdf_file in pdf_files: # Some pdfs cause known crashes. Exclude them. crbug.com/63549 if os.path.basename(pdf_file) in ('nullip.pdf', 'sample.pdf'): continue url = self.GetFileURLForPath(os.path.join(pdf_files_path, pdf_file)) self.AppendTab(pyauto.GURL(url)) for tab_index in range(1, len(pdf_files) + 1): self.ActivateTab(tab_index) self._PerformPDFAction('fitToHeight', tab_index=tab_index) self._PerformPDFAction('fitToWidth', tab_index=tab_index) # Assert that there is at least 1 browser window. self.assertTrue(self.GetBrowserWindowCount(), 'Browser crashed, no window is open')
476,140
def __init__(self, options, args, test): # The known list of tests. # Recognise the original abbreviations as well as full executable names. self._test_list = { "base": self.TestBase, "base_unittests": self.TestBase, "browser": self.TestBrowser, "browser_tests": self.TestBrowser, "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, "ipc": self.TestIpc, "ipc_tests": self.TestIpc, "layout": self.TestLayout, "layout_tests": self.TestLayout, "media": self.TestMedia, "media_unittests": self.TestMedia, "net": self.TestNet, "net_unittests": self.TestNet, "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, "startup": self.TestStartup, "startup_tests": self.TestStartup, "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, "ui": self.TestUI, "ui_tests": self.TestUI, "unit": self.TestUnit, "unit_tests": self.TestUnit, "app": self.TestApp, "app_unittests": self.TestApp, }
def __init__(self, options, args, test): # The known list of tests. # Recognise the original abbreviations as well as full executable names. self._test_list = { "base": self.TestBase, "base_unittests": self.TestBase, "browser": self.TestBrowser, "browser_tests": self.TestBrowser, "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, "ipc": self.TestIpc, "ipc_tests": self.TestIpc, "layout": self.TestLayout, "layout_tests": self.TestLayout, "media": self.TestMedia, "media_unittests": self.TestMedia, "net": self.TestNet, "net_unittests": self.TestNet, "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, "startup": self.TestStartup, "startup_tests": self.TestStartup, "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, "ui": self.TestUI, "ui_tests": self.TestUI, "unit": self.TestUnit, "unit_tests": self.TestUnit, "app": self.TestApp, "app_unittests": self.TestApp, }
476,141
def SetupHtmlDirectory(html_directory, clean_html_directory): """Setup the directory to store html results. All html related files are stored in the "rebaseline_html" subdirectory. Args: html_directory: parent directory that stores the rebaselining results. If None, a temp directory is created. clean_html_directory: if True, all existing files in the html directory are removed before rebaselining. Returns: the directory that stores the html related rebaselining results. """ if not html_directory: html_directory = tempfile.mkdtemp() elif not os.path.exists(html_directory): os.mkdir(html_directory) html_directory = os.path.join(html_directory, 'rebaseline_html') logging.info('Html directory: "%s"', html_directory) if clean_html_directory and os.path.exists(html_directory): shutil.rmtree(html_directory, True) logging.info('Deleted file at html directory: "%s"', html_directory) if not os.path.exists(html_directory): os.mkdir(html_directory) return html_directory
def SetupHtmlDirectory(html_directory): """Setup the directory to store html results. All html related files are stored in the "rebaseline_html" subdirectory. Args: html_directory: parent directory that stores the rebaselining results. If None, a temp directory is created. clean_html_directory: if True, all existing files in the html directory are removed before rebaselining. Returns: the directory that stores the html related rebaselining results. """ if not html_directory: html_directory = tempfile.mkdtemp() elif not os.path.exists(html_directory): os.mkdir(html_directory) html_directory = os.path.join(html_directory, 'rebaseline_html') logging.info('Html directory: "%s"', html_directory) if clean_html_directory and os.path.exists(html_directory): shutil.rmtree(html_directory, True) logging.info('Deleted file at html directory: "%s"', html_directory) if not os.path.exists(html_directory): os.mkdir(html_directory) return html_directory
476,142
def SetupHtmlDirectory(html_directory, clean_html_directory): """Setup the directory to store html results. All html related files are stored in the "rebaseline_html" subdirectory. Args: html_directory: parent directory that stores the rebaselining results. If None, a temp directory is created. clean_html_directory: if True, all existing files in the html directory are removed before rebaselining. Returns: the directory that stores the html related rebaselining results. """ if not html_directory: html_directory = tempfile.mkdtemp() elif not os.path.exists(html_directory): os.mkdir(html_directory) html_directory = os.path.join(html_directory, 'rebaseline_html') logging.info('Html directory: "%s"', html_directory) if clean_html_directory and os.path.exists(html_directory): shutil.rmtree(html_directory, True) logging.info('Deleted file at html directory: "%s"', html_directory) if not os.path.exists(html_directory): os.mkdir(html_directory) return html_directory
def SetupHtmlDirectory(html_directory, clean_html_directory): """Setup the directory to store html results. All html related files are stored in the "rebaseline_html" subdirectory. Args: html_directory: parent directory that stores the rebaselining results. If None, a temp directory is created. Returns: the directory that stores the html related rebaselining results. """ if not html_directory: html_directory = tempfile.mkdtemp() elif not os.path.exists(html_directory): os.mkdir(html_directory) html_directory = os.path.join(html_directory, 'rebaseline_html') logging.info('Html directory: "%s"', html_directory) if clean_html_directory and os.path.exists(html_directory): shutil.rmtree(html_directory, True) logging.info('Deleted file at html directory: "%s"', html_directory) if not os.path.exists(html_directory): os.mkdir(html_directory) return html_directory
476,143
def SetupHtmlDirectory(html_directory, clean_html_directory): """Setup the directory to store html results. All html related files are stored in the "rebaseline_html" subdirectory. Args: html_directory: parent directory that stores the rebaselining results. If None, a temp directory is created. clean_html_directory: if True, all existing files in the html directory are removed before rebaselining. Returns: the directory that stores the html related rebaselining results. """ if not html_directory: html_directory = tempfile.mkdtemp() elif not os.path.exists(html_directory): os.mkdir(html_directory) html_directory = os.path.join(html_directory, 'rebaseline_html') logging.info('Html directory: "%s"', html_directory) if clean_html_directory and os.path.exists(html_directory): shutil.rmtree(html_directory, True) logging.info('Deleted file at html directory: "%s"', html_directory) if not os.path.exists(html_directory): os.mkdir(html_directory) return html_directory
def SetupHtmlDirectory(html_directory, clean_html_directory): """Setup the directory to store html results. All html related files are stored in the "rebaseline_html" subdirectory. Args: html_directory: parent directory that stores the rebaselining results. If None, a temp directory is created. clean_html_directory: if True, all existing files in the html directory are removed before rebaselining. Returns: the directory that stores the html related rebaselining results. """ if not html_directory: html_directory = tempfile.mkdtemp() elif not os.path.exists(html_directory): os.mkdir(html_directory) html_directory = os.path.join(html_directory, 'rebaseline_html') logging.info('Html directory: "%s"', html_directory) if os.path.exists(html_directory): shutil.rmtree(html_directory, True) logging.info('Deleted file at html directory: "%s"', html_directory) if not os.path.exists(html_directory): os.mkdir(html_directory) return html_directory
476,144
def _GetArchiveUrl(self): """Generate the url to download latest layout test archive.
def _GetArchiveUrl(self): """Generate the url to download latest layout test archive.
476,145
def _ExtractAndAddNewBaselines(self, archive_file): """Extract new baselines from archive and add them to SVN repository.
def _ExtractAndAddNewBaselines(self, archive_file): """Extract new baselines from archive and add them to SVN repository.
476,146
def _CreateHtmlBaselineFiles(self, baseline_fullpath): """Create baseline files (old, new and diff) in html directory.
def _CreateHtmlBaselineFiles(self, baseline_fullpath): """Create baseline files (old, new and diff) in html directory.
476,147
def __init__(self, options, platforms, rebaselining_tests): self._html_directory = options.html_directory self._browser_path = options.browser_path self._platforms = platforms self._rebaselining_tests = rebaselining_tests self._html_file = os.path.join(options.html_directory, 'rebaseline.html')
def __init__(self, options, platforms, rebaselining_tests): self._html_directory = options.html_directory self._platforms = platforms self._rebaselining_tests = rebaselining_tests self._html_file = os.path.join(options.html_directory, 'rebaseline.html')
476,148
def ShowHtml(self): """Launch the rebaselining html in brwoser."""
def ShowHtml(self): """Launch the rebaselining html in brwoser."""
476,149
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
476,150
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
476,151
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
476,152
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) options.html_directory = SetupHtmlDirectory(options.html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
476,153
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) if not options.no_html_results: logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
def main(): """Main function to produce new baselines.""" option_parser = optparse.OptionParser() option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='include debug-level logging.') option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms that need ' 'rebaselining.')) option_parser.add_option('-u', '--archive_url', default=('http://build.chromium.org/buildbot/' 'layout_test_results'), help=('Url to find the layout test result archive ' 'file.')) option_parser.add_option('-t', '--archive_name', default='layout-test-results', help='Layout test result archive name.') option_parser.add_option('-w', '--webkit_canary', action='store_true', default=False, help=('If True, pull baselines from webkit.org ' 'canary bot.')) option_parser.add_option('-b', '--backup', action='store_true', default=False, help=('Whether or not to backup the original test ' 'expectations file after rebaseline.')) option_parser.add_option('-o', '--no_html_results', action='store_true', default=False, help=('If specified, do not generate html that ' 'compares the rebaselining results.')) option_parser.add_option('-d', '--html_directory', default='', help=('The directory that stores the results for ' 'rebaselining comparison.')) option_parser.add_option('-c', '--clean_html_directory', action='store_true', default=False, help=('If specified, delete all existing files in ' 'the html directory before rebaselining.')) option_parser.add_option('-e', '--browser_path', default='', help=('The browser path that you would like to ' 'use to launch the rebaselining result ' 'comparison html')) options = option_parser.parse_args()[0] # Set up our logging format. log_level = logging.INFO if options.verbose: log_level = logging.DEBUG logging.basicConfig(level=log_level, format=('%(asctime)s %(filename)s:%(lineno)-3d ' '%(levelname)s %(message)s'), datefmt='%y%m%d %H:%M:%S') # Verify 'platforms' option is valid if not options.platforms: logging.error('Invalid "platforms" option. --platforms must be specified ' 'in order to rebaseline.') sys.exit(1) platforms = [p.strip().lower() for p in options.platforms.split(',')] for platform in platforms: if not platform in REBASELINE_PLATFORM_ORDER: logging.error('Invalid platform: "%s"' % (platform)) sys.exit(1) # Adjust the platform order so rebaseline tool is running at the order of # 'mac', 'win' and 'linux'. This is in same order with layout test baseline # search paths. It simplifies how the rebaseline tool detects duplicate # baselines. Check _IsDupBaseline method for details. rebaseline_platforms = [] for platform in REBASELINE_PLATFORM_ORDER: if platform in platforms: rebaseline_platforms.append(platform) if not options.no_html_results: options.html_directory = SetupHtmlDirectory(options.html_directory, options.clean_html_directory) rebaselining_tests = set() backup = options.backup for platform in rebaseline_platforms: rebaseliner = Rebaseliner(platform, options) logging.info('') LogDashedString('Rebaseline started', platform) if rebaseliner.Run(backup): # Only need to backup one original copy of test expectation file. backup = False LogDashedString('Rebaseline done', platform) else: LogDashedString('Rebaseline failed', platform, logging.ERROR) rebaselining_tests |= set(rebaseliner.GetRebaseliningTests()) logging.info('') LogDashedString('Rebaselining result comparison started', None) html_generator = HtmlGenerator(options, rebaseline_platforms, rebaselining_tests) html_generator.GenerateHtml() html_generator.ShowHtml() LogDashedString('Rebaselining result comparison done', None) sys.exit(0)
476,154
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" # TODO(gman): Move this data to _FUNCTION_INFO? name = func.name if name.endswith("Immediate"): name = name[0:-9] if name == 'BufferData': file.Write(" uint32 data_size = size;\n") elif name == 'BufferSubData': file.Write(" uint32 data_size = size;\n") elif name == 'CompressedTexImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'CompressedTexSubImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'TexImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") elif name == 'TexSubImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") else: file.Write("// uint32 data_size = 0; // TODO(gman): get correct size!\n")
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" # TODO(gman): Move this data to _FUNCTION_INFO? name = func.name if name.endswith("Immediate"): name = name[0:-9] if name == 'BufferData' or name == 'BufferSubData': file.Write(" uint32 data_size = size;\n") elif name == 'BufferSubData': file.Write(" uint32 data_size = size;\n") elif name == 'CompressedTexImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'CompressedTexSubImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'TexImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") elif name == 'TexSubImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") else: file.Write("// uint32 data_size = 0; // TODO(gman): get correct size!\n")
476,155
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" # TODO(gman): Move this data to _FUNCTION_INFO? name = func.name if name.endswith("Immediate"): name = name[0:-9] if name == 'BufferData': file.Write(" uint32 data_size = size;\n") elif name == 'BufferSubData': file.Write(" uint32 data_size = size;\n") elif name == 'CompressedTexImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'CompressedTexSubImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'TexImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") elif name == 'TexSubImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") else: file.Write("// uint32 data_size = 0; // TODO(gman): get correct size!\n")
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" # TODO(gman): Move this data to _FUNCTION_INFO? name = func.name if name.endswith("Immediate"): name = name[0:-9] if name == 'BufferData': file.Write(" uint32 data_size = size;\n") elif (name == 'CompressedTexImage2D' or name == 'CompressedTexSubImage2D'): file.Write(" uint32 data_size = imageSize;\n") elif name == 'CompressedTexSubImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'TexImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") elif name == 'TexSubImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") else: file.Write("// uint32 data_size = 0; // TODO(gman): get correct size!\n")
476,156
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" # TODO(gman): Move this data to _FUNCTION_INFO? name = func.name if name.endswith("Immediate"): name = name[0:-9] if name == 'BufferData': file.Write(" uint32 data_size = size;\n") elif name == 'BufferSubData': file.Write(" uint32 data_size = size;\n") elif name == 'CompressedTexImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'CompressedTexSubImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'TexImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") elif name == 'TexSubImage2D': file.Write(" uint32 data_size = GLES2Util::ComputeImageDataSize(\n") file.Write(" width, height, format, type, unpack_alignment_);\n") else: file.Write("// uint32 data_size = 0; // TODO(gman): get correct size!\n")
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" # TODO(gman): Move this data to _FUNCTION_INFO? name = func.name if name.endswith("Immediate"): name = name[0:-9] if name == 'BufferData': file.Write(" uint32 data_size = size;\n") elif name == 'BufferSubData': file.Write(" uint32 data_size = size;\n") elif name == 'CompressedTexImage2D': file.Write(" uint32 data_size = imageSize;\n") elif name == 'TexImage2D' or name == 'TexSubImage2D': code = """ uint32 data_size; if (!GLES2Util::ComputeImageDataSize( width, height, format, type, unpack_alignment_, &data_size)) { return error::kOutOfBounds; } """ file.Write(code) else: file.Write("// uint32 data_size = 0; // TODO(gman): get correct size!\n")
476,157
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = n * sizeof(GLuint);\n")
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = n * sizeof(GLuint);\n")
476,158
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = n * sizeof(GLuint);\n")
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = n * sizeof(GLuint);\n")
476,159
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg()
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg()
476,160
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = ComputeImmediateDataSize(" "immediate_data_size, 1, sizeof(%s), %d);\n" % (func.info.data_type, func.info.count))
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = ComputeImmediateDataSize(" "immediate_data_size, 1, sizeof(%s), %d);\n" % (func.info.data_type, func.info.count))
476,161
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = ComputeImmediateDataSize(" "immediate_data_size, 1, sizeof(%s), %d);\n" % (func.info.data_type, func.info.count))
def WriteGetDataSizeCode(self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 data_size = ComputeImmediateDataSize(" "immediate_data_size, 1, sizeof(%s), %d);\n" % (func.info.data_type, func.info.count))
476,162
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
476,163
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
476,164
def CreateAnalyzer(self): use_gdb = common.IsMac() return tsan_analyze.TsanAnalyzer(self._source_dir)
def CreateAnalyzer(self): use_gdb = common.IsMac() return tsan_analyze.TsanAnalyzer(self._source_dir)
476,165
def __del__(self): # python unittest module is setup such that the suite gets deleted before # the test cases, which is odd because our test cases depend on # initializtions like exitmanager, autorelease pool provided by the # suite. Forcibly delete the test cases before the suite. del self._tests pyautolib.PyUITestSuiteBase.__del__(self)
def __del__(self): # python unittest module is setup such that the suite gets deleted before # the test cases, which is odd because our test cases depend on # initializtions like exitmanager, autorelease pool provided by the # suite. Forcibly delete the test cases before the suite. del self._tests pyautolib.PyUITestSuiteBase.__del__(self)
476,166
def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid())
def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid())
476,167
def __init__(self, filename): self.filename = filename self.file = open(filename, "w")
def __init__(self, filename): self.filename = filename self.file = open(filename, "w")
476,168
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.
476,169
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files.
476,170
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
476,171
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results
476,172
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', server_data['port'])) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', server_data['port'])) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
476,173
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', server_data['port'])) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
476,174
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,175
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) code = """ if (IsReservedId(%(id)s)) { SetGLError(GL_INVALID_OPERATION); return;
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) code = """ if (Is%(type)sReservedId(%(id)s)) { SetGLError(GL_INVALID_OPERATION); return;
476,176
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) code = """ if (IsReservedId(%(id)s)) { SetGLError(GL_INVALID_OPERATION); return;
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) code = """ if (IsReservedId(%(id)s)) { SetGLError(GL_INVALID_OPERATION); return;
476,177
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n" " return error::kInvalidArguments;\n" " }\n" % (func.name, func.GetLastOriginalArg().name))
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!%sHelper(n, %s)) {\n" " return error::kInvalidArguments;\n" " }\n" % (func.name, func.GetLastOriginalArg().name))
476,178
def WriteImmediateHandlerImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n" " return error::kInvalidArguments;\n" " }\n" % (func.original_name, func.GetLastOriginalArg().name))
def WriteImmediateHandlerImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!%sHelper(n, %s)) {\n" " return error::kInvalidArguments;\n" " }\n" % (func.original_name, func.GetLastOriginalArg().name))
476,179
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" MakeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" MakeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
476,180
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,181
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,182
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,183
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,184
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,185
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 client_id = c.client_id;\n") file.Write(" %sHelper(%s);\n" % (func.name, func.MakeCmdArgString("")))
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" uint32 client_id = c.client_id;\n") file.Write(" if (!%sHelper(%s)) {\n" % (func.name, func.MakeCmdArgString("")))
476,186
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" GLuint client_id;\n") file.Write(" MakeIds(1, &client_id);\n") file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeCmdArgString(""))) file.Write(" return client_id;\n") file.Write("}\n") file.Write("\n")
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" GLuint client_id;\n") file.Write(" MakeIds(&program_and_shader_id_allocator_, 1, &client_id);\n") file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeCmdArgString(""))) file.Write(" return client_id;\n") file.Write("}\n") file.Write("\n")
476,187
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,188
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,189
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,190
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,191
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" DeleteGLObjects<GL%sHelper>(n, %s);\n" % (func.name, func.GetLastOriginalArg().name))
def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" %sHelper(n, %s);\n" % (func.name, func.GetLastOriginalArg().name))
476,192
def WriteImmediateHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" DeleteGLObjects<GL%sHelper>(n, %s);\n" % (func.original_name, func.GetLastOriginalArg().name))
def WriteImmediateHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" %sHelper(n, %s);\n" % (func.original_name, func.GetLastOriginalArg().name))
476,193
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(&%s_id_allocator_, %s);\n" % (func.name[6:-1].lower(), func.MakeOriginalArgString(""))) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
476,194
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* bucket = CreateBucket(%s);\n" % bucket_arg.name) file.Write(" bucket->SetSize(len + 1);\n"); file.Write( " %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n")
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* bucket = CreateBucket(%s);\n" % bucket_arg.name) file.Write(" bucket->SetSize(len + 1);\n"); file.Write( " %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n")
476,195
def WriteGetCode(self, file): """Overridden from Argument.""" file.Write(" %s %s;\n" % (self.type, self.name)) file.Write(" if (!id_manager()->GetServiceId(c.%s, &%s)) {\n" % (self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
def 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")
476,196
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 1
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 1
476,197
def WriteGetCode(self, file): """Overridden from Argument.""" file.Write(" %s %s = c.%s;\n" % (self.type, self.name, self.name)) file.Write(" if (%s != 0 && !id_manager()->GetServiceId(%s, &%s)) {\n" % (self.name, self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
def WriteGetCode(self, file): """Overridden from Argument.""" file.Write(" %s %s = c.%s;\n" % (self.type, self.name, self.name)) file.Write(" if (%s != 0 && !id_manager()->GetServiceId(%s, &%s)) {\n" % (self.name, self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
476,198
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if self.resource_type == "Texture": return ("client_buffer_id_", "kNoError", "GL_INVALID_OPERATION") return ("client_texture_id_", "kNoError", "GL_INVALID_OPERATION")
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if self.resource_type == "Texture": return ("client_buffer_id_", "kNoError", "GL_INVALID_OPERATION") return ("client_texture_id_", "kNoError", "GL_INVALID_OPERATION")
476,199