rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
if (values[0] > bins[0]): | if (values[0] >= bins[0]): | def inline_as_py(values, bins=10, range=None): # define bins, size N if (range is not None): mn, mx = range if (mn > mx): raise AttributeError( 'max must be larger than min in range parameter.') if not np.iterable(bins): if range is None: range = (values.min(), values.max()) mn, mx = [mi+0.0 for mi in range] if mn == mx: mn -= 0.5 mx += 0.5 bins = np.linspace(mn, mx, bins+1, endpoint=True) else: bins = np.asarray(bins) if (np.diff(bins) < 0).any(): raise AttributeError( 'bins must increase monotonically.') # define n, empty array of size N+1 count = np.zeros(bins.size - 1, int) nvalues = values.size nbins = bins.size if values.size == 0: raise AttributeError( 'a must contain some data') if values[-1] < bins[0]: raise AttributeError( 'last element of a must be smaller than first element of bins') if (values[0] > bins[0]): rb = 0; else: lb = 0; rb = nvalues + 1; while(lb < rb - 1): if (values[(lb + rb) / 2.] < bins[0]): lb = (lb + rb) / 2. else: rb = (lb + rb) / 2. # Sweep through the values, counting, until they get too big lb = 0; valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) while valid: # Advance the edge caret until the current value is in the current bin while (bins[lb+1] < values[rb]): lb += 1 # Increment the current bin count[lb] += 1 # Increment the value caret rb += 1 valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) return count, bins | 9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11557/9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc/profile_histogram.py |
valid = valid & (values[rb] < bins[nbins - 1]) | valid = valid & (values[rb] < bins[nbins-1]) | def inline_as_py(values, bins=10, range=None): # define bins, size N if (range is not None): mn, mx = range if (mn > mx): raise AttributeError( 'max must be larger than min in range parameter.') if not np.iterable(bins): if range is None: range = (values.min(), values.max()) mn, mx = [mi+0.0 for mi in range] if mn == mx: mn -= 0.5 mx += 0.5 bins = np.linspace(mn, mx, bins+1, endpoint=True) else: bins = np.asarray(bins) if (np.diff(bins) < 0).any(): raise AttributeError( 'bins must increase monotonically.') # define n, empty array of size N+1 count = np.zeros(bins.size - 1, int) nvalues = values.size nbins = bins.size if values.size == 0: raise AttributeError( 'a must contain some data') if values[-1] < bins[0]: raise AttributeError( 'last element of a must be smaller than first element of bins') if (values[0] > bins[0]): rb = 0; else: lb = 0; rb = nvalues + 1; while(lb < rb - 1): if (values[(lb + rb) / 2.] < bins[0]): lb = (lb + rb) / 2. else: rb = (lb + rb) / 2. # Sweep through the values, counting, until they get too big lb = 0; valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) while valid: # Advance the edge caret until the current value is in the current bin while (bins[lb+1] < values[rb]): lb += 1 # Increment the current bin count[lb] += 1 # Increment the value caret rb += 1 valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) return count, bins | 9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11557/9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc/profile_histogram.py |
while (bins[lb+1] < values[rb]): | while (bins[lb+1] <= values[rb]): | def inline_as_py(values, bins=10, range=None): # define bins, size N if (range is not None): mn, mx = range if (mn > mx): raise AttributeError( 'max must be larger than min in range parameter.') if not np.iterable(bins): if range is None: range = (values.min(), values.max()) mn, mx = [mi+0.0 for mi in range] if mn == mx: mn -= 0.5 mx += 0.5 bins = np.linspace(mn, mx, bins+1, endpoint=True) else: bins = np.asarray(bins) if (np.diff(bins) < 0).any(): raise AttributeError( 'bins must increase monotonically.') # define n, empty array of size N+1 count = np.zeros(bins.size - 1, int) nvalues = values.size nbins = bins.size if values.size == 0: raise AttributeError( 'a must contain some data') if values[-1] < bins[0]: raise AttributeError( 'last element of a must be smaller than first element of bins') if (values[0] > bins[0]): rb = 0; else: lb = 0; rb = nvalues + 1; while(lb < rb - 1): if (values[(lb + rb) / 2.] < bins[0]): lb = (lb + rb) / 2. else: rb = (lb + rb) / 2. # Sweep through the values, counting, until they get too big lb = 0; valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) while valid: # Advance the edge caret until the current value is in the current bin while (bins[lb+1] < values[rb]): lb += 1 # Increment the current bin count[lb] += 1 # Increment the value caret rb += 1 valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) return count, bins | 9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11557/9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc/profile_histogram.py |
if bins[-1] == values[rb]: count[-1] += 1 | def inline_as_py(values, bins=10, range=None): # define bins, size N if (range is not None): mn, mx = range if (mn > mx): raise AttributeError( 'max must be larger than min in range parameter.') if not np.iterable(bins): if range is None: range = (values.min(), values.max()) mn, mx = [mi+0.0 for mi in range] if mn == mx: mn -= 0.5 mx += 0.5 bins = np.linspace(mn, mx, bins+1, endpoint=True) else: bins = np.asarray(bins) if (np.diff(bins) < 0).any(): raise AttributeError( 'bins must increase monotonically.') # define n, empty array of size N+1 count = np.zeros(bins.size - 1, int) nvalues = values.size nbins = bins.size if values.size == 0: raise AttributeError( 'a must contain some data') if values[-1] < bins[0]: raise AttributeError( 'last element of a must be smaller than first element of bins') if (values[0] > bins[0]): rb = 0; else: lb = 0; rb = nvalues + 1; while(lb < rb - 1): if (values[(lb + rb) / 2.] < bins[0]): lb = (lb + rb) / 2. else: rb = (lb + rb) / 2. # Sweep through the values, counting, until they get too big lb = 0; valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) while valid: # Advance the edge caret until the current value is in the current bin while (bins[lb+1] < values[rb]): lb += 1 # Increment the current bin count[lb] += 1 # Increment the value caret rb += 1 valid = (rb < nvalues) if valid: valid = valid & (values[rb] < bins[nbins - 1]) return count, bins | 9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11557/9e18fb4ccbe8fc12e6d4b00c5e25907331679ebc/profile_histogram.py |
|
outputs = project_dirs[project] | outputs = project_dirs[project] + '/outputs' | def make_today_dir(project='tuning_change'): outputs = project_dirs[project] today = outputs + '/' + time.strftime('%y%m%d') if not os.path.exists(today): os.mkdir(today) return today | 2d29c87718633abbb209822b9b0a5b9ffe1b7d7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11557/2d29c87718633abbb209822b9b0a5b9ffe1b7d7b/out_files.py |
def GrepForActions(path, actions): """Grep a source file for calls to UserMetrics functions. Arguments: path: path to the file actions: set of actions to add to """ global number_of_files_total number_of_files_total = number_of_files_total + 1 # we look for the UserMetricsAction structur constructor # this should be on one line action_re = re.compile(r'UserMetricsAction\("([^"]*)') computed_action_re = re.compile(r'UserMetrics::RecordComputedAction') line_number = 0 for line in open(path): line_number = line_number + 1 match = action_re.search(line) if match: # Plain call to RecordAction actions.add(match.group(1)) elif computed_action_re.search(line): # Warn if this file shouldn't be calling RecordComputedAction. if os.path.basename(path) not in KNOWN_COMPUTED_USERS: print >>sys.stderr, 'WARNING: {0} has RecordComputedAction at {1}'.\ format(path, line_number) | 7e1f5d579bc962aa590e1bf1cde4367a9fdcb2ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7e1f5d579bc962aa590e1bf1cde4367a9fdcb2ee/extract_actions.py |
||
if msg.policy_scope == 'cros/device': | if msg.policy_scope == 'chromeos/device': | def ProcessPolicy(self, msg): """Handles a policy request. | fa682f7d51bd14a9fb9e4f7ed3a874030e1c1d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa682f7d51bd14a9fb9e4f7ed3a874030e1c1d18/device_management.py |
dmtoken = None | def CheckToken(self): """Helper for checking whether the client supplied a valid DM token. | fa682f7d51bd14a9fb9e4f7ed3a874030e1c1d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa682f7d51bd14a9fb9e4f7ed3a874030e1c1d18/device_management.py |
|
if not dmtoken: error = dm.DeviceManagementResponse.DEVICE_MANAGEMENT_TOKEN_INVALID elif not self._server.LookupDevice(dmtoken): error = dm.DeviceManagementResponse.DEVICE_NOT_FOUND else: return (dmtoken, None) | if not dmtoken: error = dm.DeviceManagementResponse.DEVICE_MANAGEMENT_TOKEN_INVALID elif not self._server.LookupDevice(dmtoken): error = dm.DeviceManagementResponse.DEVICE_NOT_FOUND else: return (dmtoken, None) | def CheckToken(self): """Helper for checking whether the client supplied a valid DM token. | fa682f7d51bd14a9fb9e4f7ed3a874030e1c1d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa682f7d51bd14a9fb9e4f7ed3a874030e1c1d18/device_management.py |
file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | 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("\n") | def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | ba9076ac9e2b9ad35b8f1cee9127a758f59c439d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ba9076ac9e2b9ad35b8f1cee9127a758f59c439d/build_gles2_cmd_buffer.py |
if func.can_auto_generate and (impl_func == None or impl_func == True): | 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)): | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | ba9076ac9e2b9ad35b8f1cee9127a758f59c439d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ba9076ac9e2b9ad35b8f1cee9127a758f59c439d/build_gles2_cmd_buffer.py |
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") | 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.""" 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") | ba9076ac9e2b9ad35b8f1cee9127a758f59c439d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ba9076ac9e2b9ad35b8f1cee9127a758f59c439d/build_gles2_cmd_buffer.py |
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) all_but_last_args = func.GetOriginalArgs()[:-1] arg_string = ( ", ".join(["%s" % arg.name for arg in all_but_last_args])) code = """ typedef %(func_name)s::Result Result; | 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(""))) all_but_last_args = func.GetOriginalArgs()[:-1] arg_string = ( ", ".join(["%s" % arg.name for arg in all_but_last_args])) code = """ typedef %(func_name)s::Result Result; | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) all_but_last_args = func.GetOriginalArgs()[:-1] arg_string = ( ", ".join(["%s" % arg.name for arg in all_but_last_args])) code = """ typedef %(func_name)s::Result Result; | ba9076ac9e2b9ad35b8f1cee9127a758f59c439d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ba9076ac9e2b9ad35b8f1cee9127a758f59c439d/build_gles2_cmd_buffer.py |
helper_->%(func_name)s(%(arg_string)s, result_shm_id(), result_shm_offset()); | helper_->%(func_name)s(%(arg_string)s, result_shm_id(), result_shm_offset()); | code = """ typedef %(func_name)s::Result Result; | ba9076ac9e2b9ad35b8f1cee9127a758f59c439d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ba9076ac9e2b9ad35b8f1cee9127a758f59c439d/build_gles2_cmd_buffer.py |
file.Write(code % { 'func_name': func.name, 'arg_string': arg_string, }) | file.Write(code % { 'func_name': func.name, 'arg_string': arg_string, }) | code = """ typedef %(func_name)s::Result Result; | ba9076ac9e2b9ad35b8f1cee9127a758f59c439d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ba9076ac9e2b9ad35b8f1cee9127a758f59c439d/build_gles2_cmd_buffer.py |
action is to wait for 60secs, and can be changed by changing kWaitForActionMaxMsec in ui_test.cc. | action is to wait for kWaitForActionMaxMsec, as set in ui_test.cc | def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout. | 2304add6954b3e90297814aa6374bc13be7b0af8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2304add6954b3e90297814aa6374bc13be7b0af8/pyauto.py |
Deaults to 0.25 secs. | Defaults to 0.25 secs. | def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout. | 2304add6954b3e90297814aa6374bc13be7b0af8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2304add6954b3e90297814aa6374bc13be7b0af8/pyauto.py |
url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html')) | url = self.GetFileURLForDataPath('title2.html') | def testHistoryResult(self): """Verify that omnibox can fetch items from history.""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html')) title = 'Title Of Awesomeness' self.AppendTab(pyauto.GURL(url)) def _VerifyHistoryResult(query_list, description, windex=0): """Verify result matching given description for given list of queries.""" for query_text in query_list: matches = self._GetOmniboxMatchesFor( query_text, windex=windex, attr_dict={'description': description}) self.assertTrue(matches) self.assertEqual(1, len(matches)) item = matches[0] self.assertEqual(url, item['destination_url']) # Query using URL & title _VerifyHistoryResult([url, title], title) # Verify results in another tab self.AppendTab(pyauto.GURL()) _VerifyHistoryResult([url, title], title) # Verify results in another window self.OpenNewBrowserWindow(True) self.WaitUntilOmniboxReadyHack(windex=1) _VerifyHistoryResult([url, title], title, windex=1) # Verify results in an incognito window self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) self.WaitUntilOmniboxReadyHack(windex=2) _VerifyHistoryResult([url, title], title, windex=2) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
url1 = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html')) url2 = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) | url1 = self.GetFileURLForDataPath('title2.html') url2 = self.GetFileURLForDataPath('title1.html') | def testSelect(self): """Verify omnibox popup selection.""" url1 = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html')) url2 = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) title1 = 'Title Of Awesomeness' self.NavigateToURL(url1) self.NavigateToURL(url2) matches = self._GetOmniboxMatchesFor('file://') self.assertTrue(matches) # Find the index of match for url1 index = None for i, match in enumerate(matches): if match['description'] == title1: index = i self.assertTrue(index is not None) self.OmniboxMovePopupSelection(index) # Select url1 line in popup self.assertEqual(url1, self.GetOmniboxInfo().Text()) self.OmniboxAcceptInput() self.assertEqual(title1, self.GetActiveTabTitle()) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
"""Verify suggest results in omnibox.""" | """Verify suggested results in omnibox.""" | def testSuggest(self): """Verify suggest results in omnibox.""" matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) self.assertTrue([x for x in matches if x['type'] == 'search-suggest']) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
def testDifferentTypesOfResults(self): """Verify different types of results from omnibox. | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
||
matches = self._GetOmniboxMatchesFor('google') | matches = self._GetOmniboxMatchesFor(search_string) | def testDifferentTypesOfResults(self): """Verify different types of results from omnibox. | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
"""Verify omnibox suggest-service enable/disable pref.""" | """Verify no suggests for omnibox when suggested-services disabled.""" search_string = 'apple' | def testSuggestPref(self): """Verify omnibox suggest-service enable/disable pref.""" self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kSearchSuggestEnabled)) matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) self.assertTrue([x for x in matches if x['type'] == 'search-suggest']) # Disable suggest-service self.SetPrefs(pyauto.kSearchSuggestEnabled, False) self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kSearchSuggestEnabled)) matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) # Verify there are no suggest results self.assertFalse([x for x in matches if x['type'] == 'search-suggest']) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
matches = self._GetOmniboxMatchesFor('apple') | matches = self._GetOmniboxMatchesFor(search_string) | def testSuggestPref(self): """Verify omnibox suggest-service enable/disable pref.""" self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kSearchSuggestEnabled)) matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) self.assertTrue([x for x in matches if x['type'] == 'search-suggest']) # Disable suggest-service self.SetPrefs(pyauto.kSearchSuggestEnabled, False) self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kSearchSuggestEnabled)) matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) # Verify there are no suggest results self.assertFalse([x for x in matches if x['type'] == 'search-suggest']) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
matches = self._GetOmniboxMatchesFor('apple') | matches = self._GetOmniboxMatchesFor(search_string) | def testSuggestPref(self): """Verify omnibox suggest-service enable/disable pref.""" self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kSearchSuggestEnabled)) matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) self.assertTrue([x for x in matches if x['type'] == 'search-suggest']) # Disable suggest-service self.SetPrefs(pyauto.kSearchSuggestEnabled, False) self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kSearchSuggestEnabled)) matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) # Verify there are no suggest results self.assertFalse([x for x in matches if x['type'] == 'search-suggest']) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
def _CheckBookmarkResultForVariousInputs(self, url, title, windex=0): """Check if we get the Bookmark for complete and partial inputs.""" # Check if the complete URL would get the bookmark url_matches = self._GetOmniboxMatchesFor(url, windex=windex) self._VerifyHasBookmarkResult(url_matches) # Check if the complete title would get the bookmark title_matches = self._GetOmniboxMatchesFor(title, windex=windex) self._VerifyHasBookmarkResult(title_matches) # Check if the partial URL would get the bookmark split_url = urlparse.urlsplit(url) partial_url = self._GetOmniboxMatchesFor(split_url.scheme, windex=windex) self._VerifyHasBookmarkResult(partial_url) # Check if the partial title would get the bookmark split_title = title.split() search_term = split_title[len(split_title) - 1] partial_title = self._GetOmniboxMatchesFor(search_term, windex=windex) self._VerifyHasBookmarkResult(partial_title) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
||
def _CheckBookmarkResultForVariousInputs(self, url, title, windex=0): """Check if we get the Bookmark for complete and partial inputs.""" # Check if the complete URL would get the bookmark url_matches = self._GetOmniboxMatchesFor(url, windex=windex) self._VerifyHasBookmarkResult(url_matches) # Check if the complete title would get the bookmark title_matches = self._GetOmniboxMatchesFor(title, windex=windex) self._VerifyHasBookmarkResult(title_matches) # Check if the partial URL would get the bookmark split_url = urlparse.urlsplit(url) partial_url = self._GetOmniboxMatchesFor(split_url.scheme, windex=windex) self._VerifyHasBookmarkResult(partial_url) # Check if the partial title would get the bookmark split_title = title.split() search_term = split_title[len(split_title) - 1] partial_title = self._GetOmniboxMatchesFor(search_term, windex=windex) self._VerifyHasBookmarkResult(partial_title) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
||
def _CheckBookmarkResultForVariousInputs(self, url, title, windex=0): """Check if we get the Bookmark for complete and partial inputs.""" # Check if the complete URL would get the bookmark url_matches = self._GetOmniboxMatchesFor(url, windex=windex) self._VerifyHasBookmarkResult(url_matches) # Check if the complete title would get the bookmark title_matches = self._GetOmniboxMatchesFor(title, windex=windex) self._VerifyHasBookmarkResult(title_matches) # Check if the partial URL would get the bookmark split_url = urlparse.urlsplit(url) partial_url = self._GetOmniboxMatchesFor(split_url.scheme, windex=windex) self._VerifyHasBookmarkResult(partial_url) # Check if the partial title would get the bookmark split_title = title.split() search_term = split_title[len(split_title) - 1] partial_title = self._GetOmniboxMatchesFor(search_term, windex=windex) self._VerifyHasBookmarkResult(partial_title) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
||
def _CheckBookmarkResultForVariousInputs(self, url, title, windex=0): """Check if we get the Bookmark for complete and partial inputs.""" # Check if the complete URL would get the bookmark url_matches = self._GetOmniboxMatchesFor(url, windex=windex) self._VerifyHasBookmarkResult(url_matches) # Check if the complete title would get the bookmark title_matches = self._GetOmniboxMatchesFor(title, windex=windex) self._VerifyHasBookmarkResult(title_matches) # Check if the partial URL would get the bookmark split_url = urlparse.urlsplit(url) partial_url = self._GetOmniboxMatchesFor(split_url.scheme, windex=windex) self._VerifyHasBookmarkResult(partial_url) # Check if the partial title would get the bookmark split_title = title.split() search_term = split_title[len(split_title) - 1] partial_title = self._GetOmniboxMatchesFor(search_term, windex=windex) self._VerifyHasBookmarkResult(partial_title) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
||
"""Verify that omnibox can recognize bookmark in the search options in new tabs and Windows. """ | """Verify that omnibox can recognize a bookmark within search options in new tabs and windows.""" | def testBookmarkResultInNewTabAndWindow(self): """Verify that omnibox can recognize bookmark in the search options in new tabs and Windows. """ url = self.GetFileURLForDataPath('title2.html') self.NavigateToURL(url) title = 'This is Awesomeness' bookmarks = self.GetBookmarkModel() bar_id = bookmarks.BookmarkBar()['id'] self.AddBookmarkURL(bar_id, 0, title, url) bookmarks = self.GetBookmarkModel() nodes = bookmarks.FindByTitle(title) self.AppendTab(pyauto.GURL(url)) self._CheckBookmarkResultForVariousInputs(url, title) self.OpenNewBrowserWindow(True) self.assertEqual(2, self.GetBrowserWindowCount()) self.NavigateToURL(url, 1, 0) self._CheckBookmarkResultForVariousInputs(url, title, windex=1) self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) self.assertEqual(3, self.GetBrowserWindowCount()) self.NavigateToURL(url, 2, 0) self._CheckBookmarkResultForVariousInputs(url, title, windex=2) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py |
with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: | archive = tarfile.open(output_fullname, 'w:bz2') try: | def ShouldExcludePath(path): head, tail = os.path.split(path) if tail in ('.svn', '.git'): return True | 55ae0190890bf5ebcba15ea41b1f00c695dff89f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/55ae0190890bf5ebcba15ea41b1f00c695dff89f/export_tarball.py |
if 'delta' not in perf_data[key] or 'var' not in perf_data[key]: bad_keys.append(key) if (not isinstance(perf_data[key]['delta'], int) and not isinstance(perf_data[key]['delta'], float)): bad_keys.append(key) if (not isinstance(perf_data[key]['var'], int) and not isinstance(perf_data[key]['var'], float)): bad_keys.append(key) | if 'regress' in perf_data[key]: if 'improve' not in perf_data[key]: bad_keys.append(key) if (not isinstance(perf_data[key]['regress'], int) and not isinstance(perf_data[key]['regress'], float)): bad_keys.append(key) if (not isinstance(perf_data[key]['improve'], int) and not isinstance(perf_data[key]['improve'], float)): bad_keys.append(key) else: if 'delta' not in perf_data[key] or 'var' not in perf_data[key]: bad_keys.append(key) if (not isinstance(perf_data[key]['delta'], int) and not isinstance(perf_data[key]['delta'], float)): bad_keys.append(key) if (not isinstance(perf_data[key]['var'], int) and not isinstance(perf_data[key]['var'], float)): bad_keys.append(key) | def testPerfExpectations(self): perf_data = LoadData() | b1025ba3afc3b463d7d55e95c9e0b542cc63ff67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1025ba3afc3b463d7d55e95c9e0b542cc63ff67/perf_expectations_unittest.py |
SANITY_TEST_SUPPRESSIONS_LINUX = { | SANITY_TEST_SUPPRESSIONS = { | def find_and_truncate(f): f.seek(0) while True: line = f.readline() if line == "": return False if '</valgrindoutput>' in line: # valgrind often has garbage after </valgrindoutput> upon crash f.truncate() return True | 7fcb9a25d24814a37d618fd3c2636f7eb2dba070 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7fcb9a25d24814a37d618fd3c2636f7eb2dba070/memcheck_analyze.py |
} SANITY_TEST_SUPPRESSIONS_MAC = { "Memcheck sanity test 01 (memory leak).": 1, "Memcheck sanity test 02 (malloc/read left).": 1, "Memcheck sanity test 03 (malloc/read right).": 1, "Memcheck sanity test 06 (new/read left).": 1, "Memcheck sanity test 07 (new/read right).": 1, "Memcheck sanity test 10 (write after free).": 1, "Memcheck sanity test 11 (write after delete).": 1, "bug_49253 Memcheck sanity test 12 (array deleted without []) on Mac.": 1, "bug_49253 Memcheck sanity test 13 (single element deleted with []) on Mac.": 1, "bug_49253 Memcheck sanity test 04 (malloc/write left) or Memcheck sanity test 05 (malloc/write right) on Mac.": 2, "bug_49253 Memcheck sanity test 08 (new/write left) or Memcheck sanity test 09 (new/write right) on Mac.": 2, | def find_and_truncate(f): f.seek(0) while True: line = f.readline() if line == "": return False if '</valgrindoutput>' in line: # valgrind often has garbage after </valgrindoutput> upon crash f.truncate() return True | 7fcb9a25d24814a37d618fd3c2636f7eb2dba070 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7fcb9a25d24814a37d618fd3c2636f7eb2dba070/memcheck_analyze.py |
|
if common.IsLinux(): remaining_sanity_supp = MemcheckAnalyzer.SANITY_TEST_SUPPRESSIONS_LINUX elif common.IsMac(): remaining_sanity_supp = MemcheckAnalyzer.SANITY_TEST_SUPPRESSIONS_MAC else: remaining_sanity_supp = {} if check_sanity: logging.warn("No sanity test list for platform %s", sys.platform) | remaining_sanity_supp = MemcheckAnalyzer.SANITY_TEST_SUPPRESSIONS | def Report(self, files, check_sanity=False): '''Reads in a set of files and prints Memcheck report. | 7fcb9a25d24814a37d618fd3c2636f7eb2dba070 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7fcb9a25d24814a37d618fd3c2636f7eb2dba070/memcheck_analyze.py |
file = self.path[len(prefix):] if file.find('?') > -1: url, querystring = file.split('?') else: url = file entries = url.split('/') path = os.path.join(self.server.data_dir, *entries) if os.path.isdir(path): path = os.path.join(path, 'index.html') if not os.path.isfile(path): print "File not found " + file + " full path:" + path | _, _, url_path, _, query, _ = urlparse.urlparse(self.path) sub_path = url_path[len(prefix):] entries = sub_path.split('/') file_path = os.path.join(self.server.data_dir, *entries) if os.path.isdir(file_path): file_path = os.path.join(file_path, 'index.html') if not os.path.isfile(file_path): print "File not found " + sub_path + " full path:" + file_path | def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!""" | aa36f586cbe59a6e7c1e5f942a2340077678f23c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aa36f586cbe59a6e7c1e5f942a2340077678f23c/testserver.py |
f = open(path, "rb") | f = open(file_path, "rb") | def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!""" | aa36f586cbe59a6e7c1e5f942a2340077678f23c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aa36f586cbe59a6e7c1e5f942a2340077678f23c/testserver.py |
headers_path = path + '.mock-http-headers' | headers_path = file_path + '.mock-http-headers' | def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!""" | aa36f586cbe59a6e7c1e5f942a2340077678f23c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aa36f586cbe59a6e7c1e5f942a2340077678f23c/testserver.py |
self.send_header('Content-type', self.GetMIMETypeFromName(file)) | self.send_header('Content-type', self.GetMIMETypeFromName(file_path)) | def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!""" | aa36f586cbe59a6e7c1e5f942a2340077678f23c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aa36f586cbe59a6e7c1e5f942a2340077678f23c/testserver.py |
'http://chromium-status.appspot.com/current?format=raw', '(?i).*closed.*')) | json_url='http://chromium-status.appspot.com/current?format=json')) | def CheckChangeOnCommit(input_api, output_api): results = [] if not input_api.json: results.append(output_api.PresubmitNotifyResult( 'You don\'t have json nor simplejson installed.\n' ' This is a warning that you will need to upgrade your python ' 'installation.\n' ' This is no big deal but you\'ll eventually need to ' 'upgrade.\n' ' How? Easy! You can do it right now and shut me off! Just:\n' ' del depot_tools\\python.bat\n' ' gclient\n' ' Thanks for your patience.')) results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. results.extend(input_api.canned_checks.CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/current?format=raw', '(?i).*closed.*')) results.extend(input_api.canned_checks.CheckRietveldTryJobExecution(input_api, output_api, 'http://codereview.chromium.org', ('win', 'linux', 'mac'), '[email protected]')) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(input_api.canned_checks.CheckBuildbotPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders?filter=1', 6, IGNORED_BUILDERS)) return results | 548bd271ccdc19bf009078b5e76baf9af0420f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/548bd271ccdc19bf009078b5e76baf9af0420f75/PRESUBMIT.py |
output = posixpath.splitext(output)[0] + ".o3dtgz" | output_base = posixpath.splitext(output)[0] output_tgz = output_base + ".o3dtgz" output_json = output_base + "/scene.json" output = output_tgz if webgl_mode: output = output_json | def write_action(asset, webgl_mode): filename = posixpath.splitext(posixpath.basename(asset['path']))[0] filename = filename.replace('.','_') filename = filename.replace('-','_') filename = filename.lower() name = "convert_" + filename if webgl_mode: name = name + "_webgl" output = asset['path'].replace('convert_', '') output = posixpath.splitext(output)[0] + ".o3dtgz" output_dir = posixpath.dirname(output) output_file.write(" {\n") output_file.write(" 'action_name': '%s',\n" % name) output_file.write(" 'inputs': [\n") output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n") output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path']) output_file.write(" ],\n") output_file.write(" 'outputs': [\n") if sys.platform[:5] == 'linux': # TODO(gspencer): This is a HACK! We shouldn't need to put the # absolute path here, but currently on Linux (scons), it is unable # to copy generated items out of the source tree (because the # repository mojo fails to find it and puts in the wrong path). output_file.write(" '%s',\n" % posixpath.abspath(output)) else: output_file.write(" '../samples/%s',\n" % output) output_file.write(" ],\n") output_file.write(" 'action': [\n") output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n") output_file.write(" '--no-condition',\n") output_file.write(" '--up-axis=%s',\n" % asset['up']) if webgl_mode: output_file.write(" '--no-binary',\n") output_file.write(" '--no-archive',\n") output_file.write(" '--convert-dds-to-png',\n") output_file.write(" '--convert-cg-to-glsl',\n") output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path']) output_file.write(" '<(_outputs)',\n") output_file.write(" ],\n") output_file.write(" },\n") | c1d68e3887ce83ecb89b20fecb5dfaec4e243be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c1d68e3887ce83ecb89b20fecb5dfaec4e243be3/samples_gen.py |
output_file.write(" '<(_outputs)',\n") | if webgl_mode: output_file.write(" '%s',\n" % output_tgz) else: output_file.write(" '<(_outputs)',\n") | def write_action(asset, webgl_mode): filename = posixpath.splitext(posixpath.basename(asset['path']))[0] filename = filename.replace('.','_') filename = filename.replace('-','_') filename = filename.lower() name = "convert_" + filename if webgl_mode: name = name + "_webgl" output = asset['path'].replace('convert_', '') output = posixpath.splitext(output)[0] + ".o3dtgz" output_dir = posixpath.dirname(output) output_file.write(" {\n") output_file.write(" 'action_name': '%s',\n" % name) output_file.write(" 'inputs': [\n") output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n") output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path']) output_file.write(" ],\n") output_file.write(" 'outputs': [\n") if sys.platform[:5] == 'linux': # TODO(gspencer): This is a HACK! We shouldn't need to put the # absolute path here, but currently on Linux (scons), it is unable # to copy generated items out of the source tree (because the # repository mojo fails to find it and puts in the wrong path). output_file.write(" '%s',\n" % posixpath.abspath(output)) else: output_file.write(" '../samples/%s',\n" % output) output_file.write(" ],\n") output_file.write(" 'action': [\n") output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n") output_file.write(" '--no-condition',\n") output_file.write(" '--up-axis=%s',\n" % asset['up']) if webgl_mode: output_file.write(" '--no-binary',\n") output_file.write(" '--no-archive',\n") output_file.write(" '--convert-dds-to-png',\n") output_file.write(" '--convert-cg-to-glsl',\n") output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path']) output_file.write(" '<(_outputs)',\n") output_file.write(" ],\n") output_file.write(" },\n") | c1d68e3887ce83ecb89b20fecb5dfaec4e243be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c1d68e3887ce83ecb89b20fecb5dfaec4e243be3/samples_gen.py |
proc = subprocess.Popen(['git'] + command, stdout=subprocess.PIPE) | shell = (os.name == 'nt') proc = subprocess.Popen(['git'] + command, shell=shell, stdout=subprocess.PIPE) | def RunGit(command): """Run a git subcommand, returning its output.""" proc = subprocess.Popen(['git'] + command, stdout=subprocess.PIPE) return proc.communicate()[0].strip() | 518e0028821eee26f7f22ed40e99e5ab0f588578 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/518e0028821eee26f7f22ed40e99e5ab0f588578/sync-webkit-git.py |
'--pretty=medium', 'origin'], | '--pretty=medium', 'origin'], shell=shell, | def FindSVNRev(target_rev): """Map an SVN revision to a git hash. Like 'git svn find-rev' but without the git-svn bits.""" # We iterate through the commit log looking for "git-svn-id" lines, # which contain the SVN revision of that commit. We can stop once # we've found our target (or hit a revision number lower than what # we're looking for, indicating not found). target_rev = int(target_rev) # regexp matching the "commit" line from the log. commit_re = re.compile(r'^commit ([a-f\d]{40})$') # regexp matching the git-svn line from the log. git_svn_re = re.compile(r'^\s+git-svn-id: [^@]+@(\d+) ') log = subprocess.Popen(['git', 'log', '--no-color', '--first-parent', '--pretty=medium', 'origin'], stdout=subprocess.PIPE) # Track whether we saw a revision *later* than the one we're seeking. saw_later = False for line in log.stdout: match = commit_re.match(line) if match: commit = match.group(1) continue match = git_svn_re.match(line) if match: rev = int(match.group(1)) if rev <= target_rev: log.stdout.close() # Break pipe. if rev < target_rev: if not saw_later: return None # Can't be sure whether this rev is ok. print ("WARNING: r%d not found, so using next nearest earlier r%d" % (target_rev, rev)) return commit else: saw_later = True print "Error: reached end of log without finding commit info." print "Something has likely gone horribly wrong." return None | 518e0028821eee26f7f22ed40e99e5ab0f588578 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/518e0028821eee26f7f22ed40e99e5ab0f588578/sync-webkit-git.py |
self.assertEqual('Popup Success!', blocked_popups[0]['title']) | def testPopupBlockerEnabled(self): """Verify popup blocking is enabled.""" self.assertFalse(self.GetBlockedPopupsInfo(), msg='Should have no blocked popups on startup') file_url = self.GetFileURLForPath(os.path.join( self.DataDir(), 'popup_blocker', 'popup-blocked-to-post-blank.html')) self.NavigateToURL(file_url) blocked_popups = self.GetBlockedPopupsInfo() self.assertEqual(1, len(blocked_popups), msg='Popup not blocked') self.assertEqual('Popup Success!', blocked_popups[0]['title']) | ff79e1e9eda961f16315b0811f544ff39a085664 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ff79e1e9eda961f16315b0811f544ff39a085664/popups.py |
|
'<a href="http://localhost:8888/echo">back to referring page</a></div>' | '<a href="/echo">back to referring page</a></div>' | def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents.""" | b1364e081e9a5c511778fec70e77a599995bfb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1364e081e9a5c511778fec70e77a599995bfb01/testserver.py |
print 'HTTPS server started on port %d...' % port | print 'HTTPS server started on port %d...' % server.server_port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): 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) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b1364e081e9a5c511778fec70e77a599995bfb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1364e081e9a5c511778fec70e77a599995bfb01/testserver.py |
print 'HTTP server started on port %d...' % port | print 'HTTP server started on port %d...' % server.server_port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): 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) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b1364e081e9a5c511778fec70e77a599995bfb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1364e081e9a5c511778fec70e77a599995bfb01/testserver.py |
listen_port = server.server_port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): 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) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b1364e081e9a5c511778fec70e77a599995bfb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1364e081e9a5c511778fec70e77a599995bfb01/testserver.py |
|
print 'FTP server started on port %d...' % port | listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): 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) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b1364e081e9a5c511778fec70e77a599995bfb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1364e081e9a5c511778fec70e77a599995bfb01/testserver.py |
startup_pipe.write("READY") | startup_pipe.write(struct.pack('@H', listen_port)) | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): 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) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b1364e081e9a5c511778fec70e77a599995bfb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1364e081e9a5c511778fec70e77a599995bfb01/testserver.py |
option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.') | option_parser.add_option('', '--port', default='0', type='int', help='Port used by the server. If unspecified, the ' 'server will listen on an ephemeral port.') | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): 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) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b1364e081e9a5c511778fec70e77a599995bfb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1364e081e9a5c511778fec70e77a599995bfb01/testserver.py |
if len(args) != 1: print 'You must provide only one argument: path to the test binary' | if not args: print 'You must provide path to the test binary' | def main(argv): parser = optparse.OptionParser() parser.add_option("--shards", type="int", dest="shards", default=10) options, args = parser.parse_args(argv) if len(args) != 1: print 'You must provide only one argument: path to the test binary' return 1 launchers = [] for shard in range(options.shards): launcher = TestLauncher(args[0], args[0], options.shards, shard) launcher.launch() launchers.append(launcher) return_code = 0 for launcher in launchers: if launcher.wait() != 0: return_code = 1 return return_code | 5fbea88f423de6096b2f5e3ebef8c2cd14678266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5fbea88f423de6096b2f5e3ebef8c2cd14678266/parallel_launcher.py |
launcher = TestLauncher(args[0], args[0], options.shards, shard) | launcher = TestLauncher(args, args[0], options.shards, shard) | def main(argv): parser = optparse.OptionParser() parser.add_option("--shards", type="int", dest="shards", default=10) options, args = parser.parse_args(argv) if len(args) != 1: print 'You must provide only one argument: path to the test binary' return 1 launchers = [] for shard in range(options.shards): launcher = TestLauncher(args[0], args[0], options.shards, shard) launcher.launch() launchers.append(launcher) return_code = 0 for launcher in launchers: if launcher.wait() != 0: return_code = 1 return return_code | 5fbea88f423de6096b2f5e3ebef8c2cd14678266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5fbea88f423de6096b2f5e3ebef8c2cd14678266/parallel_launcher.py |
self.KillHandler, | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.KillHandler, self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 814d8c519498ba4f6ab732363a6f66cc5da8a33c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/814d8c519498ba4f6ab732363a6f66cc5da8a33c/testserver.py |
|
def KillHandler(self): """This request handler kills the server, for use when we're done" with the a particular test.""" if (self.path.find("kill") < 0): return False self.send_response(200) self.send_header('Content-type', 'text/html') self.send_header('Cache-Control', 'max-age=0') self.end_headers() if options.never_die: self.wfile.write('I cannot die!! BWAHAHA') else: self.wfile.write('Goodbye cruel world!') self.server.stop = True return True | def KillHandler(self): """This request handler kills the server, for use when we're done" with the a particular test.""" | 814d8c519498ba4f6ab732363a6f66cc5da8a33c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/814d8c519498ba4f6ab732363a6f66cc5da8a33c/testserver.py |
|
def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) | def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) | 814d8c519498ba4f6ab732363a6f66cc5da8a33c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/814d8c519498ba4f6ab732363a6f66cc5da8a33c/testserver.py |
|
pyftpdlib.ftpserver.logline = line_logger | def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) | 814d8c519498ba4f6ab732363a6f66cc5da8a33c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/814d8c519498ba4f6ab732363a6f66cc5da8a33c/testserver.py |
|
option_parser.add_option('', '--never-die', default=False, action="store_true", help='Prevent the server from dying when visiting ' 'a /kill URL. Useful for manually running some ' 'tests.') | def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) | 814d8c519498ba4f6ab732363a6f66cc5da8a33c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/814d8c519498ba4f6ab732363a6f66cc5da8a33c/testserver.py |
|
if (%(id)s != 0) { %(lc_type)s_id_allocator_.MarkAsUsed(%(id)s); } | %(lc_type)s_id_handler_->MarkAsUsedForBind(%(id)s); | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file, func) code = """ if (Is%(type)sReservedId(%(id)s)) { SetGLError(GL_INVALID_OPERATION, "%(name)s: %(id)s reserved id"); return; | 4c88460a7b91becd0096dcec4b3ba1338a49bc73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c88460a7b91becd0096dcec4b3ba1338a49bc73/build_gles2_cmd_buffer.py |
MakeIds(&%(resource_type)s_id_allocator_, %(args)s); | %(resource_type)s_id_handler_->MakeIds(0, %(args)s); | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) { | 4c88460a7b91becd0096dcec4b3ba1338a49bc73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c88460a7b91becd0096dcec4b3ba1338a49bc73/build_gles2_cmd_buffer.py |
file.Write(" MakeIds(&program_and_shader_id_allocator_, 1, &client_id);\n") | file.Write(" program_and_shader_id_handler_->MakeIds(0, 1, &client_id);\n") | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" GLuint client_id;\n") file.Write(" MakeIds(&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") | 4c88460a7b91becd0096dcec4b3ba1338a49bc73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c88460a7b91becd0096dcec4b3ba1338a49bc73/build_gles2_cmd_buffer.py |
file.Write(" FreeIds(&%s_id_allocator_, %s);\n" % | file.Write(" %s_id_handler_->FreeIds(%s);\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") | 4c88460a7b91becd0096dcec4b3ba1338a49bc73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c88460a7b91becd0096dcec4b3ba1338a49bc73/build_gles2_cmd_buffer.py |
module_dir = os.path.join(self._source_dir, module) self._data_dirs = [path_utils.ScriptDir()] if module == "chrome": self._data_dirs.append(os.path.join(module_dir, "test", "data", "valgrind")) else: self._data_dirs.append(os.path.join(module_dir, "data", "valgrind")) | def _DefaultCommand(self, tool, module, exe=None, valgrind_test_args=None): '''Generates the default command array that most tests will use.''' module_dir = os.path.join(self._source_dir, module) | d35297c058de3a3b67fa5f3676e7a2532504540b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d35297c058de3a3b67fa5f3676e7a2532504540b/chrome_tests.py |
|
for directory in self._data_dirs: tool_name = tool.ToolName(); suppression_file = os.path.join(directory, "%s/suppressions.txt" % tool_name) if os.path.exists(suppression_file): cmd.append("--suppressions=%s" % suppression_file) for suppression_platform in common.PlatformNames(): suppression_file_platform = \ os.path.join(directory, '%s/suppressions_%s.txt' % (tool_name, suppression_platform)) if os.path.exists(suppression_file_platform): cmd.append("--suppressions=%s" % suppression_file_platform) | script_dir = path_utils.ScriptDir() tool_name = tool.ToolName(); suppression_file = os.path.join(script_dir, tool_name, "suppressions.txt") if os.path.exists(suppression_file): cmd.append("--suppressions=%s" % suppression_file) for platform in common.PlatformNames(): platform_suppression_file = \ os.path.join(script_dir, tool_name, 'suppressions_%s.txt' % platform) if os.path.exists(platform_suppression_file): cmd.append("--suppressions=%s" % platform_suppression_file) | def _DefaultCommand(self, tool, module, exe=None, valgrind_test_args=None): '''Generates the default command array that most tests will use.''' module_dir = os.path.join(self._source_dir, module) | d35297c058de3a3b67fa5f3676e7a2532504540b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d35297c058de3a3b67fa5f3676e7a2532504540b/chrome_tests.py |
for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%s.txt" % \ tool.ToolName())] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(directory, name + ".gtest_%s.txt" % platform_suffix), os.path.join(directory, name + ".gtest-%s_%s.txt" % \ (tool.ToolName(), platform_suffix))] for filename in gtest_filter_files: if os.path.exists(filename): logging.info("reading gtest filters from %s" % filename) f = open(filename, 'r') for line in f.readlines(): if line.startswith(" continue line = line.rstrip() test_prefixes = ["FLAKY", "FAILS"] for p in test_prefixes: line = line.replace(".%s_" % p, ".") filters.append(line) if line[-2:] != ".*": for p in test_prefixes: filters.append(line.replace(".", ".%s_" % p)) | gtest_files_dir = os.path.join(path_utils.ScriptDir(), "gtest_exclude") gtest_filter_files = [ os.path.join(gtest_files_dir, name + ".gtest.txt"), os.path.join(gtest_files_dir, name + ".gtest-%s.txt" % tool.ToolName())] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(gtest_files_dir, name + ".gtest_%s.txt" % platform_suffix), os.path.join(gtest_files_dir, name + ".gtest-%s_%s.txt" % \ (tool.ToolName(), platform_suffix))] for filename in gtest_filter_files: if not os.path.exists(filename): logging.info("gtest filter file %s not found - skipping" % filename) continue logging.info("Reading gtest filters from %s" % filename) f = open(filename, 'r') for line in f.readlines(): if line.startswith(" continue line = line.rstrip() test_prefixes = ["FLAKY", "FAILS"] for p in test_prefixes: line = line.replace(".%s_" % p, ".") filters.append(line) if line[-2:] != ".*": for p in test_prefixes: filters.append(line.replace(".", ".%s_" % p)) | def _ReadGtestFilterFile(self, tool, name, cmd): '''Read a file which is a list of tests to filter out with --gtest_filter and append the command-line option to cmd. ''' filters = [] for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%s.txt" % \ tool.ToolName())] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(directory, name + ".gtest_%s.txt" % platform_suffix), os.path.join(directory, name + ".gtest-%s_%s.txt" % \ (tool.ToolName(), platform_suffix))] for filename in gtest_filter_files: if os.path.exists(filename): logging.info("reading gtest filters from %s" % filename) f = open(filename, 'r') for line in f.readlines(): if line.startswith("#") or line.startswith("//") or line.isspace(): continue line = line.rstrip() test_prefixes = ["FLAKY", "FAILS"] for p in test_prefixes: # Strip prefixes from the test names. line = line.replace(".%s_" % p, ".") # Exclude the original test name. filters.append(line) if line[-2:] != ".*": # List all possible prefixes if line doesn't end with ".*". for p in test_prefixes: filters.append(line.replace(".", ".%s_" % p)) # Get rid of duplicates. filters = set(filters) gtest_filter = self._gtest_filter if len(filters): if gtest_filter: gtest_filter += ":" if gtest_filter.find("-") < 0: gtest_filter += "-" else: gtest_filter = "-" gtest_filter += ":".join(filters) if gtest_filter: cmd.append("--gtest_filter=%s" % gtest_filter) | d35297c058de3a3b67fa5f3676e7a2532504540b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d35297c058de3a3b67fa5f3676e7a2532504540b/chrome_tests.py |
(len(parts[ii]) > 0 and not parts[ii][0] == ")") | (len(parts[ii]) > 0 and not parts[ii][0] == ")" and not fptr.match(parts[ii])) | def __FindSplit(self, string): """Finds a place to split a string.""" splitter = string.find('=') if splitter >= 0 and not string[splitter + 1] == '=' and splitter < 80: return splitter parts = string.split('(') if len(parts) > 1: splitter = len(parts[0]) for ii in range(1, len(parts)): if (not parts[ii - 1][-3:] == "if " and (len(parts[ii]) > 0 and not parts[ii][0] == ")") and splitter < 80): return splitter splitter += len(parts[ii]) + 1 done = False end = len(string) last_splitter = -1 while not done: splitter = string[0:end].rfind(',') if splitter < 0: return last_splitter elif splitter >= 80: end = splitter else: return splitter | 8549b9f45547e09f8d1fc9cae1f9eb51438bfd38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8549b9f45547e09f8d1fc9cae1f9eb51438bfd38/build_gles2_cmd_buffer.py |
def __init__(self, filename, file_comment = None): | def __init__(self, filename, file_comment = None, guard_depth = None): | def __init__(self, filename, file_comment = None): CWriter.__init__(self, filename) | 8549b9f45547e09f8d1fc9cae1f9eb51438bfd38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8549b9f45547e09f8d1fc9cae1f9eb51438bfd38/build_gles2_cmd_buffer.py |
base = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) hpath = os.path.abspath(filename)[len(base) + 1:] | if guard_depth == None: hpath = os.path.relpath(filename) else: base = os.path.abspath(filename) for i in xrange(0, guard_depth): base = os.path.dirname(base) hpath = os.path.relpath(base) | def __init__(self, filename, file_comment = None): CWriter.__init__(self, filename) | 8549b9f45547e09f8d1fc9cae1f9eb51438bfd38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8549b9f45547e09f8d1fc9cae1f9eb51438bfd38/build_gles2_cmd_buffer.py |
file.Write("}\n"); | file.Write("}\n\n"); | def WriteServiceUtilsImplementation(self, filename): """Writes the gles2 auto generated utility implementation.""" file = CHeaderWriter(filename) enums = sorted(_ENUM_LISTS.keys()) for enum in enums: if len(_ENUM_LISTS[enum]['valid']) > 0: file.Write("static %s valid_%s_table[] = {\n" % (_ENUM_LISTS[enum]['type'], ToUnderscore(enum))) for value in _ENUM_LISTS[enum]['valid']: file.Write(" %s,\n" % value) file.Write("};\n") file.Write("\n") file.Write("Validators::Validators()\n") pre = ': ' post = ',' count = 0 for enum in enums: count += 1 if count == len(enums): post = ' {' if len(_ENUM_LISTS[enum]['valid']) > 0: code = """ %(pre)s%(name)s( valid_%(name)s_table, arraysize(valid_%(name)s_table))%(post)s | 8549b9f45547e09f8d1fc9cae1f9eb51438bfd38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8549b9f45547e09f8d1fc9cae1f9eb51438bfd38/build_gles2_cmd_buffer.py |
gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") | if options.alternate_mode == "ppapi": gen.WritePepperGLES2Interface("ppapi/c/ppb_opengles.h") elif options.alternate_mode == "chrome_ppapi": gen.WritePepperGLES2Implementation("webkit/glue/plugins/pepper_graphics_3d_gl.cc") else: gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") | def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "--generate-docs", action="store_true", help="generate a docs friendly version of the command formats.") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1) | 8549b9f45547e09f8d1fc9cae1f9eb51438bfd38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8549b9f45547e09f8d1fc9cae1f9eb51438bfd38/build_gles2_cmd_buffer.py |
self.AddFunction(f) f.type_handler.AddImmediateFunction(self, f) f.type_handler.AddBucketFunction(self, f) | gen_cmd = f.GetInfo('gen_cmd') if gen_cmd == True or gen_cmd == None: self.AddFunction(f) f.type_handler.AddImmediateFunction(self, f) f.type_handler.AddBucketFunction(self, f) | def ParseGLH(self, filename): """Parses the GL2.h file and extracts the functions""" for line in _GL_FUNCTIONS.splitlines(): match = self._function_re.match(line) if match: func_name = match.group(2)[2:] func_info = self.GetFunctionInfo(func_name) if func_info.type != 'Noop': return_type = match.group(1).strip() arg_string = match.group(3) (args, num_pointer_args, is_gl_enum) = self.ParseArgs(arg_string) # comment in to find out which functions use bare enums. # if is_gl_enum: # self.Log("%s uses bare GLenum" % func_name) args_for_cmds = args if hasattr(func_info, 'cmd_args'): (args_for_cmds, num_pointer_args, is_gl_enum) = ( self.ParseArgs(getattr(func_info, 'cmd_args'))) cmd_args = [] for arg in args_for_cmds: arg.AddCmdArgs(cmd_args) init_args = [] for arg in args_for_cmds: arg.AddInitArgs(init_args) return_arg = CreateArg(return_type + " result") if return_arg: init_args.append(return_arg) f = Function(func_name, func_name, func_info, return_type, args, args_for_cmds, cmd_args, init_args, num_pointer_args) self.original_functions.append(f) self.AddFunction(f) f.type_handler.AddImmediateFunction(self, f) f.type_handler.AddBucketFunction(self, f) | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) by_id[_CMD_ID_TABLE[func.name]] = func | if True: if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) by_id[_CMD_ID_TABLE[func.name]] = func | def WriteCommandIds(self, filename): """Writes the command buffer format""" file = CHeaderWriter(filename) file.Write("#define GLES2_COMMAND_LIST(OP) \\\n") by_id = {} for func in self.functions: if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) by_id[_CMD_ID_TABLE[func.name]] = func for id in sorted(by_id.keys()): file.Write(" %-60s /* %d */ \\\n" % ("OP(%s)" % by_id[id].name, id)) file.Write("\n") | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
func.WriteStruct(file) | if True: func.WriteStruct(file) | def WriteFormat(self, filename): """Writes the command buffer format""" file = CHeaderWriter(filename) for func in self.functions: func.WriteStruct(file) file.Write("\n") file.Close() | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
func.WriteDocs(file) | if True: func.WriteDocs(file) | def WriteDocs(self, filename): """Writes the command buffer doc version of the commands""" file = CWriter(filename) for func in self.functions: func.WriteDocs(file) file.Write("\n") file.Close() | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
func.WriteFormatTest(file) | if True: func.WriteFormatTest(file) | def WriteFormatTest(self, filename): """Writes the command buffer format test.""" file = CHeaderWriter( filename, "// This file contains unit tests for gles2 commmands\n" "// It is included by gles2_cmd_format_test.cc\n" "\n") | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) file.Write(" COMPILE_ASSERT(%s::kCmdId == %d,\n" % (func.name, _CMD_ID_TABLE[func.name])) file.Write(" GLES2_%s_kCmdId_mismatch);\n" % func.name) | if True: if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) file.Write(" COMPILE_ASSERT(%s::kCmdId == %d,\n" % (func.name, _CMD_ID_TABLE[func.name])) file.Write(" GLES2_%s_kCmdId_mismatch);\n" % func.name) | def WriteCommandIdTest(self, filename): """Writes the command id test.""" file = CHeaderWriter( filename, "// This file contains unit tests for gles2 commmand ids\n") | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
func.WriteCmdHelper(file) | if True: func.WriteCmdHelper(file) | def WriteCmdHelperHeader(self, filename): """Writes the gles2 command helper.""" file = CHeaderWriter(filename) | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
func.WriteServiceImplementation(file) | if True: func.WriteServiceImplementation(file) | def WriteServiceImplementation(self, filename): """Writes the service decorder implementation.""" file = CHeaderWriter( filename, "// It is included by gles2_cmd_decoder.cc\n") | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file) | if True: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file) | def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file) | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py |
def __str__(self): return 'Failed with code %s: %s' % (self.message, repr(self.error_code)) | 225aef4d1775945ef3f069dfdc5404a00cc0ce10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/225aef4d1775945ef3f069dfdc5404a00cc0ce10/generate_stubs.py |
||
return STUB_FUNCTION_DEFINITION % { 'return_type': signature['return_type'], 'name': signature['name'], 'params': ', '.join(signature['params']), 'return_prefix': return_prefix, 'arg_list': arg_list} | if arg_list != '' and len(arguments) > 1 and arguments[-1] == '...': if return_prefix != '': return VARIADIC_STUB_FUNCTION_DEFINITION % { 'return_type': signature['return_type'], 'name': signature['name'], 'params': ', '.join(signature['params']), 'arg_list': ', '.join(arguments[0:-1]), 'last_named_arg': arguments[-2]} else: return VOID_VARIADIC_STUB_FUNCTION_DEFINITION % { 'name': signature['name'], 'params': ', '.join(signature['params']), 'arg_list': ', '.join(arguments[0:-1]), 'last_named_arg': arguments[-2]} else: return STUB_FUNCTION_DEFINITION % { 'return_type': signature['return_type'], 'name': signature['name'], 'params': ', '.join(signature['params']), 'return_prefix': return_prefix, 'arg_list': arg_list} | def StubFunction(cls, signature): """Generates a stub function definition for the given signature. | 225aef4d1775945ef3f069dfdc5404a00cc0ce10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/225aef4d1775945ef3f069dfdc5404a00cc0ce10/generate_stubs.py |
from pyautolib import PyUITestSuite | from pyautolib import * | def _LocateBinDirs(): script_dir = os.path.dirname(__file__) chrome_src = os.path.join(script_dir, os.pardir, os.pardir, os.pardir) bin_dirs = { 'linux2': [ os.path.join(chrome_src, 'out', 'Debug'), os.path.join(chrome_src, 'sconsbuild', 'Debug'), os.path.join(chrome_src, 'out', 'Release'), os.path.join(chrome_src, 'sconsbuild', 'Release')], 'darwin': [ os.path.join(chrome_src, 'xcodebuild', 'Debug'), os.path.join(chrome_src, 'xcodebuild', 'Release')], 'win32': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], 'cygwin': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], } sys.path += bin_dirs.get(sys.platform, []) | 91d88f75702697b806923a4a8245d52499c57873 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/91d88f75702697b806923a4a8245d52499c57873/pyauto.py |
self.WaitForNotificationCount(1) self._CreateHTMLNotification(self.NO_SUCH_URL2, 'chat') | def testNotificationReplacement(self): """Test that we can replace a notification using the replaceId.""" self._AllowAllOrigins() self.NavigateToURL(self.TEST_PAGE_URL) self._CreateHTMLNotification(self.NO_SUCH_URL, 'chat') self.WaitForNotificationCount(1) self._CreateHTMLNotification(self.NO_SUCH_URL2, 'chat') notifications = self.GetActiveNotifications() self.assertEquals(1, len(notifications)) self.assertEquals(self.NO_SUCH_URL2, notifications[0]['content_url']) | fa5f9112a4ab829b8153e2427e24f85e8c16cc79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa5f9112a4ab829b8153e2427e24f85e8c16cc79/notifications.py |
|
self.assertEquals(self.NO_SUCH_URL2, notifications[0]['content_url']) | self.assertEquals(self.NO_SUCH_URL, notifications[0]['content_url']) | def testNotificationReplacement(self): """Test that we can replace a notification using the replaceId.""" self._AllowAllOrigins() self.NavigateToURL(self.TEST_PAGE_URL) self._CreateHTMLNotification(self.NO_SUCH_URL, 'chat') self.WaitForNotificationCount(1) self._CreateHTMLNotification(self.NO_SUCH_URL2, 'chat') notifications = self.GetActiveNotifications() self.assertEquals(1, len(notifications)) self.assertEquals(self.NO_SUCH_URL2, notifications[0]['content_url']) | fa5f9112a4ab829b8153e2427e24f85e8c16cc79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa5f9112a4ab829b8153e2427e24f85e8c16cc79/notifications.py |
PermanentItem('google_chrome_extensions', name='Extensions', parent_tag='google_chrome', sync_type=EXTENSIONS), PermanentItem('google_chrome_passwords', name='Passwords', parent_tag='google_chrome', sync_type=PASSWORD), | def __init__(self, tag, name, parent_tag, sync_type): self.tag = tag self.name = name self.parent_tag = parent_tag self.sync_type = sync_type | 169156b2f729dd209ab7154e5569e27f784948be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/169156b2f729dd209ab7154e5569e27f784948be/chromiumsync.py |
|
continue if line == '{': skip_next_line = True | def CheckChange(input_api, output_api): """Checks the memcheck suppressions files for bad data.""" errors = [] skip_next_line = False func_re = input_api.re.compile('[a-z_.]+\(.+\)$') for f, line_num, line in input_api.RightHandSideLines(lambda x: x.LocalPath().endswith('.txt')): line = line.lstrip() if line.startswith('#') or not line: continue if skip_next_line: skip_next_line = False continue if (line.startswith('fun:') or line.startswith('obj:') or line.startswith('Memcheck:') or line == '}' or line == '...'): continue if func_re.match(line): continue if line == '{': skip_next_line = True continue errors.append('"%s" is probably wrong: %s line %s' % (line, f.LocalPath(), line_num)) if errors: return [output_api.PresubmitError('\n'.join(errors))] return [] | 515cd121c6eefe82e0017073815cb5ceecf0d030 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/515cd121c6eefe82e0017073815cb5ceecf0d030/PRESUBMIT.py |
|
proc = subprocess.Popen(['git'] + command, shell=shell, stdout=subprocess.PIPE) return proc.communicate()[0].strip() | proc = subprocess.Popen(command, shell=shell, stdout=subprocess.PIPE) out = proc.communicate()[0].strip() logging.info('Returned "%s"' % out) return out | def RunGit(command): """Run a git subcommand, returning its output.""" # On Windows, use shell=True to get PATH interpretation. shell = (os.name == 'nt') proc = subprocess.Popen(['git'] + command, shell=shell, stdout=subprocess.PIPE) return proc.communicate()[0].strip() | 44352fb92c99120b312967481ebe6e000b76bfa4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/44352fb92c99120b312967481ebe6e000b76bfa4/sync-webkit-git.py |
log = subprocess.Popen(['git', 'log', '--no-color', '--first-parent', '--pretty=medium', 'origin'], shell=(os.name == 'nt'), stdout=subprocess.PIPE) | cmd = ['git', 'log', '--no-color', '--first-parent', '--pretty=medium', 'origin/master'] logging.info(' '.join(cmd)) log = subprocess.Popen(cmd, shell=(os.name == 'nt'), stdout=subprocess.PIPE) | def FindSVNRev(target_rev): """Map an SVN revision to a git hash. Like 'git svn find-rev' but without the git-svn bits.""" # We iterate through the commit log looking for "git-svn-id" lines, # which contain the SVN revision of that commit. We can stop once # we've found our target (or hit a revision number lower than what # we're looking for, indicating not found). target_rev = int(target_rev) # regexp matching the "commit" line from the log. commit_re = re.compile(r'^commit ([a-f\d]{40})$') # regexp matching the git-svn line from the log. git_svn_re = re.compile(r'^\s+git-svn-id: [^@]+@(\d+) ') log = subprocess.Popen(['git', 'log', '--no-color', '--first-parent', '--pretty=medium', 'origin'], shell=(os.name == 'nt'), stdout=subprocess.PIPE) # Track whether we saw a revision *later* than the one we're seeking. saw_later = False for line in log.stdout: match = commit_re.match(line) if match: commit = match.group(1) continue match = git_svn_re.match(line) if match: rev = int(match.group(1)) if rev <= target_rev: log.stdout.close() # Break pipe. if rev < target_rev: if not saw_later: return None # Can't be sure whether this rev is ok. print ("WARNING: r%d not found, so using next nearest earlier r%d" % (target_rev, rev)) return commit else: saw_later = True print "Error: reached end of log without finding commit info." print "Something has likely gone horribly wrong." return None | 44352fb92c99120b312967481ebe6e000b76bfa4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/44352fb92c99120b312967481ebe6e000b76bfa4/sync-webkit-git.py |
path_utils.PlatformName(), options.target == 'Debug') | path_utils.PlatformName(), self._options.target == 'Debug') | def PrepareListsAndPrintOutput(self, write): """Create appropriate subsets of test lists and returns a ResultSummary object. Also prints expected test counts. | ea941151f3bec1e0a60138f7d9a162ee9bd93434 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ea941151f3bec1e0a60138f7d9a162ee9bd93434/run_chromium_webkit_tests.py |
startup_pipe.write(struct.pack('@H', listen_port)) | startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(server_data_json) | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): 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 | d3f157dd265ecc1d71b7556d2bd2ae491f6646ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d3f157dd265ecc1d71b7556d2bd2ae491f6646ee/testserver.py |
except: | except SQLExecutionError: | def testDeleteNonexistentRow(self): """Attempts to delete a nonexistent row in the table.""" self.NavigateToURL(self.TEST_PAGE_URL) self._CreateTable() self._InsertRecord('text') did_throw_exception = False try: self._DeleteRecord(1) except: did_throw_exception = True self.assertTrue(did_throw_exception) self.assertEquals(['text'], self._GetRecords()) | a41c3ac6f7e48ac6751e1b3a750b52eacc911ff1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a41c3ac6f7e48ac6751e1b3a750b52eacc911ff1/databases.py |
can_read_regular_database = False try: if len(self._GetRecords(windex=1)) == 1: can_read_regular_database = True except SQLExecutionError: pass self.assertFalse(can_read_regular_database) self._CreateTable(windex=1) self.assertEqual(0, len(self._GetRecords(windex=1))) | self.assertFalse(self._HasTable(windex=1)) self._CreateTable(windex=1) self.assertFalse(self._GetRecords(windex=1)) | def testIncognitoCannotReadRegularDatabase(self): """Attempt to read a database created in a regular browser from an incognito browser. """ self.NavigateToURL(self.TEST_PAGE_URL) self._CreateTable() self._InsertRecord('text') self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) self.NavigateToURL(self.TEST_PAGE_URL, 1, 0) can_read_regular_database = False try: # |_GetRecords| should throw an error because the table does not exist. if len(self._GetRecords(windex=1)) == 1: can_read_regular_database = True except SQLExecutionError: pass self.assertFalse(can_read_regular_database) self._CreateTable(windex=1) self.assertEqual(0, len(self._GetRecords(windex=1))) | a41c3ac6f7e48ac6751e1b3a750b52eacc911ff1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a41c3ac6f7e48ac6751e1b3a750b52eacc911ff1/databases.py |
can_read_incognito_database = False try: if len(self._GetRecords()) == 1: can_read_incognito_database = True except SQLExecutionError: pass self.assertFalse(can_read_incognito_database) | self.assertFalse(self._HasTable()) self._CreateTable() self.assertFalse(self._GetRecords()) | def testRegularCannotReadIncognitoDatabase(self): """Attempt to read a database created in an incognito browser from a regular browser. """ self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) self.NavigateToURL(self.TEST_PAGE_URL, 1, 0) self._CreateTable(windex=1) self._InsertRecord('text', windex=1) | a41c3ac6f7e48ac6751e1b3a750b52eacc911ff1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a41c3ac6f7e48ac6751e1b3a750b52eacc911ff1/databases.py |
'%s seems to contain a definition of DllRegisterServer.\n' | '%s contains a definition of DllRegisterServer at line %s.\n' | def CheckNoDllRegisterServer(input_api, output_api): for f, line_num, line in input_api.RightHandSideLines(): if DLL_REGISTER_SERVER_RE.search(line): file_name = os.path.basename(f.LocalPath()) if file_name not in ['install_utils.h', 'install_utils_unittest.cc']: return [output_api.PresubmitError( '%s seems to contain a definition of DllRegisterServer.\n' 'Please search for CEEE_DEFINE_DLL_REGISTER_SERVER.' % f.LocalPath())] return [] | cbd33c4268f30f01274582ebe0becc6b9e643fa5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/cbd33c4268f30f01274582ebe0becc6b9e643fa5/ceee_presubmit.py |
f.LocalPath())] | (f.LocalPath(), line_num))] | def CheckNoDllRegisterServer(input_api, output_api): for f, line_num, line in input_api.RightHandSideLines(): if DLL_REGISTER_SERVER_RE.search(line): file_name = os.path.basename(f.LocalPath()) if file_name not in ['install_utils.h', 'install_utils_unittest.cc']: return [output_api.PresubmitError( '%s seems to contain a definition of DllRegisterServer.\n' 'Please search for CEEE_DEFINE_DLL_REGISTER_SERVER.' % f.LocalPath())] return [] | cbd33c4268f30f01274582ebe0becc6b9e643fa5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/cbd33c4268f30f01274582ebe0becc6b9e643fa5/ceee_presubmit.py |
arg.WriteClientSideValidationCode(file) | arg.WriteClientSideValidationCode(file, func) | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
arg.WriteClientSideValidationCode(file) | arg.WriteClientSideValidationCode(file, func) | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.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; | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
SetGLError(GL_INVALID_OPERATION); | SetGLError(GL_INVALID_OPERATION, "%(name)s: %(id)s reserved id"); | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)): file.Write("%s %s(%s) {\n" % (func.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; | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
SetGLError(GL_INVALID_ENUM); | SetGLError(GL_INVALID_ENUM, "gl%(func_name)s: invalid enum"); | code = """ typedef %(func_name)s::Result Result; | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.