Changeset 148185 in webkit
- Timestamp:
- Apr 11, 2013 1:46:28 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r148184 r148185 1 2013-04-11 Ryosuke Niwa <rniwa@webkit.org> 2 3 Remove the rest of Chromium code from webkitpy 4 https://bugs.webkit.org/show_bug.cgi?id=114420 5 6 Reviewed by Benjamin Poulain. 7 8 * Scripts/webkitpy/common/config/urls.py: 9 (view_revision_url): 10 * Scripts/webkitpy/common/host.py: 11 (Host._engage_awesome_locale_hacks): 12 (Host.initialize_scm): 13 (Host): 14 * Scripts/webkitpy/common/host_mock.py: 15 (MockHost.__init__): 16 (MockHost.checkout): 17 * Scripts/webkitpy/common/net/buildbot/chromiumbuildbot.py: Removed. 18 * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: 19 (JSONResultsGeneratorBase._insert_generic_metadata): 20 * Scripts/webkitpy/layout_tests/models/test_expectations.py: 21 (TestExpectationParser._tokenize_line): 22 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: 23 (ExpectationSyntaxTests.test_bare_name_and_bugs): 24 (ExpectationSyntaxTests.test_warnings): 25 * Scripts/webkitpy/layout_tests/port/base.py: 26 (Port.skips_perf_test): 27 (Port.path_to_test_expectations_file): 28 (Port._port_flag_for_scripts): 29 * Scripts/webkitpy/style/checkers/cpp.py: 30 (check_function_definition): 31 (check_include_line): 32 * Scripts/webkitpy/style/checkers/cpp_unittest.py: 33 (OrderOfIncludesTest.test_check_wtf_includes): 34 (WebKitStyleTest.test_webkit_export_check): 35 * Scripts/webkitpy/style/checkers/test_expectations_unittest.py: 36 (TestExpectationsTestCase.test_valid_expectations): 37 * Scripts/webkitpy/tool/bot/irc_command.py: 38 (Rollout.execute): 39 * Scripts/webkitpy/tool/bot/irc_command_unittest.py: 40 (IRCCommandTest.test_whois): 41 * Scripts/webkitpy/tool/bot/ircbot_unittest.py: 42 (IRCBotTest.test_help): 43 * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py: 44 (SheriffBotTest.test_command_aliases): 45 1 46 2013-04-11 Ryosuke Niwa <rniwa@webkit.org> 2 47 -
trunk/Tools/Scripts/webkitpy/common/config/urls.py
r138603 r148185 38 38 39 39 40 def chromium_results_zip_url(builder_name):41 return 'http://build.chromium.org/f/chromium/layout_test_results/%s/layout-test-results.zip' % builder_name42 43 chromium_lkgr_url = "http://chromium-status.appspot.com/lkgr"44 40 contribution_guidelines = "http://webkit.org/coding/contributing.html" 45 41 … … 55 51 56 52 buildbot_url = "http://build.webkit.org" 57 chromium_buildbot_url = "http://build.chromium.org/p/chromium.webkit"58 59 chromium_webkit_sheriff_url = "http://build.chromium.org/p/chromium.webkit/sheriff_webkit.js"60 53 61 54 omahaproxy_url = "http://omahaproxy.appspot.com/" -
trunk/Tools/Scripts/webkitpy/common/host.py
r130356 r148185 36 36 from webkitpy.common.memoized import memoized 37 37 from webkitpy.common.net import bugzilla, buildbot, web 38 from webkitpy.common.net.buildbot.chromiumbuildbot import ChromiumBuildBot39 38 from webkitpy.common.system.systemhost import SystemHost 40 39 from webkitpy.common.watchlist.watchlistloader import WatchListLoader … … 80 79 os.environ['LC_ALL'] = '' 81 80 82 # FIXME: This is a horrible, horrible hack for ChromiumWin and should be removed.83 # Maybe this belongs in SVN in some more generic "find the svn binary" codepath?84 # Or possibly Executive should have a way to emulate shell path-lookups?85 # FIXME: Unclear how to test this, since it currently mutates global state on SVN.86 def _engage_awesome_windows_hacks(self):87 try:88 self.executive.run_command(['svn', 'help'])89 except OSError, e:90 try:91 self.executive.run_command(['svn.bat', 'help'])92 # Chromium Win uses the depot_tools package, which contains a number93 # of development tools, including Python and svn. Instead of using a94 # real svn executable, depot_tools indirects via a batch file, called95 # svn.bat. This batch file allows depot_tools to auto-update the real96 # svn executable, which is contained in a subdirectory.97 #98 # That's all fine and good, except that subprocess.popen can detect99 # the difference between a real svn executable and batch file when we100 # don't provide use shell=True. Rather than use shell=True on Windows,101 # We hack the svn.bat name into the SVN class.102 _log.debug('Engaging svn.bat Windows hack.')103 from webkitpy.common.checkout.scm.svn import SVN104 SVN.executable_name = 'svn.bat'105 except OSError, e:106 _log.debug('Failed to engage svn.bat Windows hack.')107 try:108 self.executive.run_command(['git', 'help'])109 except OSError, e:110 try:111 self.executive.run_command(['git.bat', 'help'])112 # Chromium Win uses the depot_tools package, which contains a number113 # of development tools, including Python and git. Instead of using a114 # real git executable, depot_tools indirects via a batch file, called115 # git.bat. This batch file allows depot_tools to auto-update the real116 # git executable, which is contained in a subdirectory.117 #118 # That's all fine and good, except that subprocess.popen can detect119 # the difference between a real git executable and batch file when we120 # don't provide use shell=True. Rather than use shell=True on Windows,121 # We hack the git.bat name into the SVN class.122 _log.debug('Engaging git.bat Windows hack.')123 from webkitpy.common.checkout.scm.git import Git124 Git.executable_name = 'git.bat'125 except OSError, e:126 _log.debug('Failed to engage git.bat Windows hack.')127 128 81 def initialize_scm(self, patch_directories=None): 129 if sys.platform == "win32":130 self._engage_awesome_windows_hacks()131 82 detector = SCMDetector(self.filesystem, self.executive) 132 83 self._scm = detector.default_scm(patch_directories) … … 145 96 146 97 @memoized 147 def chromium_buildbot(self):148 return ChromiumBuildBot()149 150 @memoized151 98 def watch_list(self): 152 99 return WatchListLoader(self.filesystem).load() -
trunk/Tools/Scripts/webkitpy/common/host_mock.py
r141182 r148185 54 54 self.bugs = MockBugzilla() 55 55 self.buildbot = MockBuildBot() 56 self._chromium_buildbot = MockBuildBot()57 56 58 57 # Note: We're using a real PortFactory here. Tests which don't wish to depend … … 74 73 return self._checkout 75 74 76 def chromium_buildbot(self):77 return self._chromium_buildbot78 79 75 def watch_list(self): 80 76 return self._watch_list -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
r143833 r148185 525 525 # Include SVN revisions for the given repositories. 526 526 for (name, path) in self._svn_repositories: 527 # Note: for JSON file's backward-compatibility we use 'chrome' rather 528 # than 'chromium' here. 529 lowercase_name = name.lower() 530 if lowercase_name == 'chromium': 531 lowercase_name = 'chrome' 532 self._insert_item_into_raw_list(results_for_builder, 533 self._get_svn_revision(path), 534 lowercase_name + 'Revision') 535 536 self._insert_item_into_raw_list(results_for_builder, 537 int(time.time()), 538 self.TIME) 527 self._insert_item_into_raw_list(results_for_builder, self._get_svn_revision(path), name.lower() + 'Revision') 528 529 self._insert_item_into_raw_list(results_for_builder, int(time.time()), self.TIME) 539 530 540 531 def _insert_test_time_and_result(self, test_name, tests): -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r142941 r148185 277 277 278 278 WEBKIT_BUG_PREFIX = 'webkit.org/b/' 279 CHROMIUM_BUG_PREFIX = 'crbug.com/'280 V8_BUG_PREFIX = 'code.google.com/p/v8/issues/detail?id='281 279 282 280 tokens = remaining_string.split() 283 281 state = 'start' 284 282 for token in tokens: 285 if (token.startswith(WEBKIT_BUG_PREFIX) or 286 token.startswith(CHROMIUM_BUG_PREFIX) or 287 token.startswith(V8_BUG_PREFIX) or 288 token.startswith('Bug(')): 283 if token.startswith(WEBKIT_BUG_PREFIX) or token.startswith('Bug('): 289 284 if state != 'start': 290 285 warnings.append('"%s" is not at the start of the line.' % token) … … 292 287 if token.startswith(WEBKIT_BUG_PREFIX): 293 288 bugs.append(token.replace(WEBKIT_BUG_PREFIX, 'BUGWK')) 294 elif token.startswith(CHROMIUM_BUG_PREFIX):295 bugs.append(token.replace(CHROMIUM_BUG_PREFIX, 'BUGCR'))296 elif token.startswith(V8_BUG_PREFIX):297 bugs.append(token.replace(V8_BUG_PREFIX, 'BUGV8_'))298 289 else: 299 290 match = re.match('Bug\((\w+)\)$', token) -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r140510 r148185 330 330 def test_bare_name_and_bugs(self): 331 331 self.assert_tokenize_exp('webkit.org/b/12345 foo.html', modifiers=['BUGWK12345', 'SKIP'], expectations=['PASS']) 332 self.assert_tokenize_exp('crbug.com/12345 foo.html', modifiers=['BUGCR12345', 'SKIP'], expectations=['PASS'])333 332 self.assert_tokenize_exp('Bug(dpranke) foo.html', modifiers=['BUGDPRANKE', 'SKIP'], expectations=['PASS']) 334 self.assert_tokenize_exp(' crbug.com/12345 crbug.com/34567 foo.html', modifiers=['BUGCR12345', 'BUGCR34567', 'SKIP'], expectations=['PASS'])333 self.assert_tokenize_exp('webkit.org/b/12345 webkit.org/b/34567 foo.html', modifiers=['BUGWK12345', 'BUGWK34567', 'SKIP'], expectations=['PASS']) 335 334 336 335 def test_comments(self): … … 366 365 self.assert_tokenize_exp('[ Mac ]', warnings=['Did not find a test name.'], name=None) 367 366 self.assert_tokenize_exp('[ [', warnings=['unexpected "["'], name=None) 368 self.assert_tokenize_exp(' crbug.com/12345 ]', warnings=['unexpected "]"'], name=None)369 370 self.assert_tokenize_exp('foo.html crbug.com/12345 ]', warnings=['"crbug.com/12345" is not at the start of the line.'])367 self.assert_tokenize_exp('webkit.org/b/12345 ]', warnings=['unexpected "]"'], name=None) 368 369 self.assert_tokenize_exp('foo.html webkit.org/b/12345 ]', warnings=['"webkit.org/b/12345" is not at the start of the line.']) 371 370 372 371 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r145916 r148185 776 776 return False 777 777 778 def is_chromium(self):779 return False780 781 778 def name(self): 782 779 """Returns a name that uniquely identifies this particular type of port … … 820 817 821 818 # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name(). 822 port_name = self.port_name 823 if port_name.startswith('chromium'): 824 port_name = 'chromium' 825 826 return self._filesystem.join(self._webkit_baseline_path(port_name), 'TestExpectations') 819 return self._filesystem.join(self._webkit_baseline_path(self.port_name), 'TestExpectations') 827 820 828 821 def relative_test_filename(self, filename): … … 1409 1402 # This is overrriden by ports which need a flag passed to scripts to distinguish the use of that port. 1410 1403 # For example --qt on linux, since a user might have both Gtk and Qt libraries installed. 1411 # FIXME: Chromium should override this once ChromiumPort is a WebKitPort.1412 1404 return None 1413 1405 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r147305 r148185 1663 1663 1664 1664 modifiers_and_return_type = function_state.modifiers_and_return_type() 1665 if filename.find('/chromium/') != -1 and search(r'\bWEBKIT_EXPORT\b', modifiers_and_return_type):1666 if filename.find('/chromium/public/') == -1 and filename.find('/chromium/tests/') == -1 and filename.find('chromium/platform') == -1:1667 error(function_state.function_name_start_position.row, 'readability/webkit_export', 5,1668 'WEBKIT_EXPORT should only appear in the chromium public (or tests) directory.')1669 elif not file_extension == "h":1670 error(function_state.function_name_start_position.row, 'readability/webkit_export', 5,1671 'WEBKIT_EXPORT should only be used in header files.')1672 elif not function_state.is_declaration or search(r'\binline\b', modifiers_and_return_type):1673 error(function_state.function_name_start_position.row, 'readability/webkit_export', 5,1674 'WEBKIT_EXPORT should not be used on a function with a body.')1675 elif function_state.is_pure:1676 error(function_state.function_name_start_position.row, 'readability/webkit_export', 5,1677 'WEBKIT_EXPORT should not be used with a pure virtual function.')1678 1679 1665 check_function_definition_and_pass_ptr(modifiers_and_return_type, function_state.function_name_start_position.row, 'return', error) 1680 1666 … … 2826 2812 error(line_number, 'build/include', 4, 2827 2813 'wtf includes should be <wtf/file.h> instead of "wtf/file.h".') 2828 2829 if filename.find('/chromium/') != -1 and include.startswith('cc/CC'):2830 error(line_number, 'build/include', 4,2831 'cc includes should be "CCFoo.h" instead of "cc/CCFoo.h".')2832 2814 2833 2815 duplicate_header = include in include_state -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r140510 r148185 2759 2759 '#include "wtf/Assertions.h"\n', 2760 2760 'wtf includes should be <wtf/file.h> instead of "wtf/file.h".' 2761 ' [build/include] [4]')2762 2763 def test_check_cc_includes(self):2764 self.assert_language_rules_check('bar/chromium/foo.cpp',2765 '#include "config.h"\n'2766 '#include "foo.h"\n'2767 '\n'2768 '#include "cc/CCProxy.h"\n',2769 'cc includes should be "CCFoo.h" instead of "cc/CCFoo.h".'2770 2761 ' [build/include] [4]') 2771 2762 … … 4796 4787 4797 4788 def test_webkit_export_check(self): 4798 webkit_export_error_rules = ('-', 4799 '+readability/webkit_export') 4789 webkit_export_error_rules = ('-', '+readability/webkit_export') 4800 4790 self.assertEqual('', 4801 self.perform_lint('WEBKIT_EXPORT int foo();\n', 4802 'WebKit/chromium/public/test.h', 4803 webkit_export_error_rules)) 4804 self.assertEqual('', 4805 self.perform_lint('WEBKIT_EXPORT int foo();\n', 4806 'WebKit/chromium/tests/test.h', 4807 webkit_export_error_rules)) 4808 self.assertEqual('WEBKIT_EXPORT should only be used in header files. [readability/webkit_export] [5]', 4809 self.perform_lint('WEBKIT_EXPORT int foo();\n', 4810 'WebKit/chromium/public/test.cpp', 4811 webkit_export_error_rules)) 4812 self.assertEqual('WEBKIT_EXPORT should only appear in the chromium public (or tests) directory. [readability/webkit_export] [5]', 4813 self.perform_lint('WEBKIT_EXPORT int foo();\n', 4814 'WebKit/chromium/src/test.h', 4815 webkit_export_error_rules)) 4816 self.assertEqual('WEBKIT_EXPORT should not be used on a function with a body. [readability/webkit_export] [5]', 4817 self.perform_lint('WEBKIT_EXPORT int foo() { }\n', 4818 'WebKit/chromium/public/test.h', 4819 webkit_export_error_rules)) 4820 self.assertEqual('WEBKIT_EXPORT should not be used on a function with a body. [readability/webkit_export] [5]', 4821 self.perform_lint('WEBKIT_EXPORT inline int foo()\n' 4822 '{\n' 4823 '}\n', 4824 'WebKit/chromium/public/test.h', 4825 webkit_export_error_rules)) 4826 self.assertEqual('WEBKIT_EXPORT should not be used with a pure virtual function. [readability/webkit_export] [5]', 4827 self.perform_lint('{}\n' 4828 'WEBKIT_EXPORT\n' 4829 'virtual\n' 4830 'int\n' 4831 'foo() = 0;\n', 4832 'WebKit/chromium/public/test.h', 4833 webkit_export_error_rules)) 4834 self.assertEqual('', 4835 self.perform_lint('{}\n' 4836 'WEBKIT_EXPORT\n' 4837 'virtual\n' 4838 'int\n' 4839 'foo() = 0;\n', 4840 'test.h', 4841 webkit_export_error_rules)) 4791 self.perform_lint( 4792 '{}\n' 4793 'WEBKIT_EXPORT\n' 4794 'virtual\n' 4795 'int\n' 4796 'foo() = 0;\n', 4797 'test.h', 4798 webkit_export_error_rules)) 4842 4799 4843 4800 def test_other(self): -
trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
r148075 r148185 114 114 115 115 def test_valid_expectations(self): 116 self.assert_lines_lint([" crbug.com/1234 [ Mac ] passes/text.html [ Pass Failure ]"], should_pass=True)116 self.assert_lines_lint(["webkit.org/b/1234 [ Mac ] passes/text.html [ Pass Failure ]"], should_pass=True) 117 117 118 118 def test_invalid_expectations(self): -
trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py
r148184 r148185 244 244 245 245 246 class Sheriffs(IRCCommand):247 usage_string = "sheriffs"248 help_string = "Retrieves who the current Chromium WebKit sheriffs are from: %s" % urls.chromium_webkit_sheriff_url249 250 def _retrieve_webkit_sheriffs(self, tool, url):251 try:252 sheriff_js = tool.web.get_binary(url, True)253 except:254 return None255 if sheriff_js == None:256 return None257 258 match = re.search(r"document.write\('(.*)'\)", sheriff_js)259 260 try:261 return match.group(1)262 except:263 return None264 265 def execute(self, nick, args, tool, sheriff):266 if not args:267 url = urls.chromium_webkit_sheriff_url268 else:269 url = args[0]270 271 sheriffs = self._retrieve_webkit_sheriffs(tool, url)272 if sheriffs == None:273 return "%s: Failed to parse URL: %s" % (nick, url)274 275 sheriff_name = "Chromium Webkit sheriff"276 sheriff_count = len(sheriffs.split())277 if sheriff_count == 0:278 return "%s: There are no %ss currently assigned." % (nick, sheriff_name)279 if sheriff_count == 1:280 return "%s: The current %s is: %s" % (nick, sheriff_name, sheriffs)281 return "%s: The current %ss are: %s" % (nick, sheriff_name, sheriffs)282 283 284 246 class Whois(IRCCommand): 285 247 usage_string = "whois SEARCH_STRING" … … 323 285 "roll-chromium-deps": RollChromiumDEPS, 324 286 "rollout": Rollout, 325 "sheriffs": Sheriffs,326 287 "whois": Whois, 327 288 } … … 333 294 commands = visible_commands.copy() 334 295 commands["revert"] = Rollout 335 commands["gardeners"] = Sheriffs336 # Enough people misspell "sheriffs" that they've requested aliases for the command.337 commands["sherriffs"] = Sheriffs338 commands["sherifs"] = Sheriffs339 commands["sherrifs"] = Sheriffs340 296 # "hello" Alias for "hi" command for the purposes of testing aliases 341 297 commands["hello"] = Hi -
trunk/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
r148180 r148185 61 61 self.assertEqual('tom: More than 5 contributors match \'david\', could you be more specific?', 62 62 whois.execute("tom", ["david"], None, None)) 63 64 @staticmethod65 def _sheriff_test_data_url(suffix):66 return "file://" + os.path.join(os.path.dirname(os.path.abspath(__file__)), "testdata", "webkit_sheriff_%s.js" % suffix)67 68 def test_sheriffs(self):69 sheriffs = Sheriffs()70 tool = MockTool(web=MockWeb({71 "test_0": "document.write('');",72 "test_1": "document.write('test_user');",73 "test_2": "document.write('test_user_1, test_user_2');",74 "test_malformed": "malformed",75 }))76 self.assertEqual("tom: There are no Chromium Webkit sheriffs currently assigned.",77 sheriffs.execute("tom", ["test_0"], tool, None))78 self.assertEqual("tom: The current Chromium Webkit sheriff is: test_user",79 sheriffs.execute("tom", ["test_1"], tool, None))80 self.assertEqual("tom: The current Chromium Webkit sheriffs are: test_user_1, test_user_2",81 sheriffs.execute("tom", ["test_2"], tool, None))82 self.assertEqual("tom: Failed to parse URL: test_malformed",83 sheriffs.execute("tom", ["test_malformed"], tool, None))84 self.assertEqual("tom: Failed to parse URL: invalid",85 sheriffs.execute("tom", ["invalid"], tool, None))86 63 87 64 def test_create_bug(self): -
trunk/Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py
r148180 r148185 89 89 90 90 def test_help(self): 91 expected_logs = 'MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, restart, roll-chromium-deps, rollout, sheriffs,whois\nMOCK: irc.post: mock_nick: Type "mock-sheriff-bot: help COMMAND" for help on my individual commands.\n'91 expected_logs = 'MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, restart, roll-chromium-deps, rollout, whois\nMOCK: irc.post: mock_nick: Type "mock-sheriff-bot: help COMMAND" for help on my individual commands.\n' 92 92 OutputCapture().assert_outputs(self, run, args=["help"], expected_logs=expected_logs) 93 93 expected_logs = 'MOCK: irc.post: mock_nick: Usage: hi\nMOCK: irc.post: mock_nick: Retrieves a random quip from Bugzilla.\nMOCK: irc.post: mock_nick: Aliases: hello\n' -
trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
r143109 r148185 30 30 from webkitpy.tool.commands import SheriffBot 31 31 from webkitpy.tool.mocktool import MockTool, MockOptions 32 from webkitpy.tool.bot.irc_command import Rollout , Sheriffs32 from webkitpy.tool.bot.irc_command import Rollout 33 33 34 34 … … 46 46 revert_command, args = irc_bot._parse_command_and_args("revert") 47 47 self.assertEqual(revert_command, Rollout) 48 # Test Sheriffs command aliases49 gardeners_command, args = irc_bot._parse_command_and_args("gardeners")50 self.assertEqual(gardeners_command, Sheriffs)51 sherifs_command, args = irc_bot._parse_command_and_args("sherifs")52 self.assertEqual(sherifs_command, Sheriffs)53 sherrifs_command, args = irc_bot._parse_command_and_args("sherrifs")54 self.assertEqual(sherrifs_command, Sheriffs)55 sherriffs_command, args = irc_bot._parse_command_and_args("sherriffs")56 self.assertEqual(sherriffs_command, Sheriffs)
Note: See TracChangeset
for help on using the changeset viewer.