Changeset 120419 in webkit
- Timestamp:
- Jun 15, 2012, 12:50:57 AM (14 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/layout_tests/port/base.py (modified) (4 diffs)
-
Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py (modified) (2 diffs)
-
Scripts/webkitpy/style/checkers/test_expectations.py (modified) (3 diffs)
-
Scripts/webkitpy/tool/mocktool.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r120394 r120419 1 2012-06-15 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r120370. 4 http://trac.webkit.org/changeset/120370 5 https://bugs.webkit.org/show_bug.cgi?id=89183 6 7 Broke webkit-patch rebaseline (Requested by zdobersek on 8 #webkit). 9 10 * Scripts/webkitpy/layout_tests/port/base.py: 11 (DummyOptions): 12 (DummyOptions.__init__): 13 (DummyOptions.__init__.this): 14 (Port.__init__): 15 (Port.get_option): 16 (Port.set_option_default): 17 * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py: 18 (ChromiumWinTest.RegisterCygwinOption): 19 (ChromiumWinTest.RegisterCygwinOption.__init__): 20 (ChromiumWinTest.test_setup_environ_for_server_register_cygwin): 21 * Scripts/webkitpy/style/checkers/test_expectations.py: 22 (TestExpectationsChecker._determine_port_from_expectations_path): 23 * Scripts/webkitpy/tool/mocktool.py: 24 (MockOptions.update): 25 1 26 2012-06-14 Xianzhu Wang <wangxianzhu@chromium.org> 2 27 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r120370 r120419 35 35 import errno 36 36 import os 37 import optparse38 37 import re 39 38 … … 63 62 64 63 64 class DummyOptions(object): 65 """Fake implementation of optparse.Values. Cloned from webkitpy.tool.mocktool.MockOptions.""" 66 67 def __init__(self, *args, **kwargs): 68 # The caller can set option values using keyword arguments. We don't 69 # set any values by default because we don't know how this 70 # object will be used. Generally speaking unit tests should 71 # subclass this or provider wrapper functions that set a common 72 # set of options. 73 for key, value in kwargs.items(): 74 self.__dict__[key] = value 75 76 65 77 # FIXME: This class should merge with WebKitPort now that Chromium behaves mostly like other webkit ports. 66 78 class Port(object): … … 100 112 # well-formed options object that had all of the necessary 101 113 # options defined on it. 102 self._options = options or optparse.Values()114 self._options = options or DummyOptions() 103 115 104 116 self.host = host … … 667 679 668 680 def get_option(self, name, default_value=None): 669 return getattr(self._options, name, default_value) 681 # FIXME: Eventually we should not have to do a test for 682 # hasattr(), and we should be able to just do 683 # self.options.value. See additional FIXME in the constructor. 684 if hasattr(self._options, name): 685 return getattr(self._options, name) 686 return default_value 670 687 671 688 def set_option_default(self, name, default_value): 672 return self._options.ensure_value(name, default_value) 689 # FIXME: Callers could also use optparse_parser.Values.ensure_value, 690 # since this should always be a optparse_parser.Values object. 691 if not hasattr(self._options, name) or getattr(self._options, name) is None: 692 return setattr(self._options, name, default_value) 673 693 674 694 def path_from_webkit_base(self, *comps): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
r120370 r120419 39 39 40 40 class ChromiumWinTest(port_testcase.PortTestCase): 41 class RegisterCygwinOption(object): 42 def __init__(self): 43 self.register_cygwin = True 44 self.results_directory = '/' 45 41 46 port_name = 'chromium-win' 42 47 port_maker = chromium_win.ChromiumWinPort … … 63 68 64 69 def test_setup_environ_for_server_register_cygwin(self): 65 port = self.make_port(options= MockOptions(register_cygwin=True, results_directory='/'))70 port = self.make_port(options=ChromiumWinTest.RegisterCygwinOption()) 66 71 port._executive = MockExecutive(should_log=True) 67 72 expected_stderr = "MOCK run_command: ['/mock-checkout/Source/WebKit/chromium/third_party/cygwin/setup_mount.bat'], cwd=None\n" -
trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
r120370 r120419 30 30 31 31 import logging 32 import optparse33 32 import os 34 33 import re … … 38 37 from webkitpy.common.host import Host 39 38 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser 39 from webkitpy.layout_tests.port.base import DummyOptions 40 40 41 41 … … 50 50 def _determine_port_from_expectations_path(self, host, expectations_path): 51 51 # Pass a configuration to avoid calling default_configuration() when initializing the port (takes 0.5 seconds on a Mac Pro!). 52 options = optparse.Values({'configuration': 'Release'})52 options = DummyOptions(configuration='Release') 53 53 for port_name in host.port_factory.all_port_names(): 54 54 port = host.port_factory.get(port_name, options=options) -
trunk/Tools/Scripts/webkitpy/tool/mocktool.py
r120370 r120419 37 37 38 38 39 # FIXME: We should just replace this with optparse.Values(default=kwargs) 39 # FIXME: This should be moved somewhere in common and renamed 40 # something without Mock in the name. 40 41 class MockOptions(object): 41 42 """Mock implementation of optparse.Values.""" … … 52 53 self.__dict__.update(**kwargs) 53 54 return self 54 55 def ensure_value(self, key, value):56 if getattr(self, key, None) == None:57 self.__dict__[key] = value58 return self.__dict__[key]59 55 60 56
Note:
See TracChangeset
for help on using the changeset viewer.