Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1609)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py

Issue 2392683003: Remove TestWebKitPort from port_testcase. (Closed)
Patch Set: Removed print; delete env var rather than setting to None Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index cbf79c8655889dbb8933caf52241d79d2f32cdf2..5986aa107c1a7781ccbe96bd9c21100c22817670 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -33,6 +33,7 @@ import unittest
from webkitpy.common.system.executive import ScriptError
from webkitpy.common.system import executive_mock
from webkitpy.common.system.filesystem_mock import MockFileSystem
+from webkitpy.common.system.platforminfo_mock import MockPlatformInfo
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.system.executive_mock import MockExecutive2
from webkitpy.common.system.systemhost import SystemHost
@@ -463,6 +464,30 @@ class PortTest(unittest.TestCase):
self.assertEqual(port.host.filesystem.cwd, '/')
self.assertEqual(port.results_directory(), '/some-directory/results')
+ def _assert_config_file_for_platform(self, port, platform, config_file):
+ port.host.platform = MockPlatformInfo(os_name=platform)
+ self.assertEqual(port._apache_config_file_name_for_platform(), config_file) # pylint: disable=protected-access
+
+ def _assert_config_file_for_linux_distribution(self, port, distribution, config_file):
+ port.host.platform = MockPlatformInfo(os_name='linux', linux_distribution=distribution)
+ self.assertEqual(port._apache_config_file_name_for_platform(), config_file) # pylint: disable=protected-access
+
+ def test_apache_config_file_name_for_platform(self):
+ port = self.make_port()
+ # pylint: disable=protected-access
+ port._apache_version = lambda: '2.2'
+ self._assert_config_file_for_platform(port, 'cygwin', 'cygwin-httpd.conf')
+ self._assert_config_file_for_platform(port, 'linux', 'apache2-httpd-2.2.conf')
+ self._assert_config_file_for_linux_distribution(port, 'arch', 'arch-httpd-2.2.conf')
+ self._assert_config_file_for_linux_distribution(port, 'debian', 'debian-httpd-2.2.conf')
+ self._assert_config_file_for_linux_distribution(port, 'slackware', 'apache2-httpd-2.2.conf')
+ self._assert_config_file_for_linux_distribution(port, 'redhat', 'redhat-httpd-2.2.conf')
+
+ self._assert_config_file_for_platform(port, 'mac', 'apache2-httpd-2.2.conf')
+ # win32 isn't a supported sys.platform. AppleWin/WinCairo/WinCE ports all use cygwin.
+ self._assert_config_file_for_platform(port, 'win32', 'apache2-httpd-2.2.conf')
+ self._assert_config_file_for_platform(port, 'barf', 'apache2-httpd-2.2.conf')
+
class NaturalCompareTest(unittest.TestCase):

Powered by Google App Engine
This is Rietveld 408576698