| OLD | NEW |
| 1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 self.assertEqual(baseline_optimizer.new_results_by_directory, expected_n
ew_results_by_directory) | 56 self.assertEqual(baseline_optimizer.new_results_by_directory, expected_n
ew_results_by_directory) |
| 57 | 57 |
| 58 def _assertOptimizationFailed(self, results_by_directory): | 58 def _assertOptimizationFailed(self, results_by_directory): |
| 59 baseline_optimizer = TestBaselineOptimizer(results_by_directory) | 59 baseline_optimizer = TestBaselineOptimizer(results_by_directory) |
| 60 self.assertFalse(baseline_optimizer.optimize('mock-baseline.png')) | 60 self.assertFalse(baseline_optimizer.optimize('mock-baseline.png')) |
| 61 | 61 |
| 62 def test_move_baselines(self): | 62 def test_move_baselines(self): |
| 63 host = MockHost() | 63 host = MockHost() |
| 64 host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/c
hromium-win/another/test-expected.txt', 'result A') | 64 host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/c
hromium-win/another/test-expected.txt', 'result A') |
| 65 host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/c
hromium-mac/another/test-expected.txt', 'result A') | 65 host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/c
hromium-mac/another/test-expected.txt', 'result A') |
| 66 host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/c
hromium/another/test-expected.txt', 'result B') | 66 host.filesystem.write_binary_file('/mock-checkout/LayoutTests/another/te
st-expected.txt', 'result B') |
| 67 baseline_optimizer = BaselineOptimizer(host, host.port_factory.all_port_
names()) | 67 baseline_optimizer = BaselineOptimizer(host, host.port_factory.all_port_
names()) |
| 68 baseline_optimizer._move_baselines('another/test-expected.txt', { | 68 baseline_optimizer._move_baselines('another/test-expected.txt', { |
| 69 'LayoutTests/platform/chromium-win': 'aaa', | 69 'LayoutTests/platform/chromium-win': 'aaa', |
| 70 'LayoutTests/platform/chromium-mac': 'aaa', | 70 'LayoutTests/platform/chromium-mac': 'aaa', |
| 71 'LayoutTests/platform/chromium': 'bbb', | 71 'LayoutTests': 'bbb', |
| 72 }, { | 72 }, { |
| 73 'LayoutTests/platform/chromium': 'aaa', | 73 'LayoutTests': 'aaa', |
| 74 }) | 74 }) |
| 75 self.assertEqual(host.filesystem.read_binary_file('/mock-checkout/Layout
Tests/platform/chromium/another/test-expected.txt'), 'result A') | 75 self.assertEqual(host.filesystem.read_binary_file('/mock-checkout/Layout
Tests/another/test-expected.txt'), 'result A') |
| 76 | 76 |
| 77 def test_chromium_linux_redundant_with_win(self): | 77 def test_chromium_linux_redundant_with_win(self): |
| 78 self._assertOptimization({ | 78 self._assertOptimization({ |
| 79 'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', | 79 'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', |
| 80 'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310
dbee5f9a9e74', | 80 'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310
dbee5f9a9e74', |
| 81 }, { | 81 }, { |
| 82 'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', | 82 'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', |
| 83 }) | 83 }) |
| 84 | 84 |
| 85 def test_chromium_covers_mac_win_linux(self): | 85 def test_chromium_covers_mac_win_linux(self): |
| 86 self._assertOptimization({ | 86 self._assertOptimization({ |
| 87 'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', | 87 'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', |
| 88 'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', | 88 'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310db
ee5f9a9e74', |
| 89 'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310
dbee5f9a9e74', | 89 'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310
dbee5f9a9e74', |
| 90 }, { | 90 }, { |
| 91 'LayoutTests/platform/chromium': '462d03b9c025db1b0392d7453310dbee5f
9a9e74', | 91 'LayoutTests': '462d03b9c025db1b0392d7453310dbee5f9a9e74', |
| 92 }) | 92 }) |
| OLD | NEW |