def test_baseline_path(self): port = chromium_win.ChromiumWinPort(port_name='chromium-win-xp') self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-win-xp')) port = chromium_win.ChromiumWinPort(port_name='chromium-win-vista') self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-win-vista')) port = chromium_win.ChromiumWinPort(port_name='chromium-win-win7') self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-win'))
def test_versions(self): port = chromium_win.ChromiumWinPort() self.assertTrue(port.name() in ('chromium-win-xp', 'chromium-win-vista', 'chromium-win-win7')) self.assert_name(None, (5, 1), 'chromium-win-xp') self.assert_name('chromium-win', (5, 1), 'chromium-win-xp') self.assert_name('chromium-win-xp', (5, 1), 'chromium-win-xp') self.assert_name('chromium-win-xp', (6, 0), 'chromium-win-xp') self.assert_name('chromium-win-xp', (6, 1), 'chromium-win-xp') self.assert_name(None, (6, 0), 'chromium-win-vista') self.assert_name('chromium-win', (6, 0), 'chromium-win-vista') self.assert_name('chromium-win-vista', (5, 1), 'chromium-win-vista') self.assert_name('chromium-win-vista', (6, 0), 'chromium-win-vista') self.assert_name('chromium-win-vista', (6, 1), 'chromium-win-vista') self.assert_name(None, (6, 1), 'chromium-win-win7') self.assert_name('chromium-win', (6, 1), 'chromium-win-win7') self.assert_name('chromium-win-win7', (5, 1), 'chromium-win-win7') self.assert_name('chromium-win-win7', (6, 0), 'chromium-win-win7') self.assert_name('chromium-win-win7', (6, 1), 'chromium-win-win7') self.assertRaises(KeyError, self.assert_name, None, (4, 0), 'chromium-win-xp') self.assertRaises(KeyError, self.assert_name, None, (5, 0), 'chromium-win-xp') self.assertRaises(KeyError, self.assert_name, None, (5, 2), 'chromium-win-xp') self.assertRaises(KeyError, self.assert_name, None, (7, 1), 'chromium-win-xp')
def test_build_path(self): mock = MockFileSystem(files={ '/mock-checkout/Source/WebKit/chromium/build/Release/DumpRenderTree.exe': 'exe'}) port = chromium_win.ChromiumWinPort(filesystem=mock) self.assertEquals( '/mock-checkout/Source/WebKit/chromium/build/Release/DumpRenderTree.exe', port._path_to_driver('Release')) self.assertEquals( '/mock-checkout/Source/WebKit/chromium/Debug/DumpRenderTree.exe', port._path_to_driver('Debug'))
def assert_name(self, port_name, windows_version, expected): port = chromium_win.ChromiumWinPort(port_name=port_name, windows_version=windows_version) self.assertEquals(expected, port.name())