| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 baseline_optimizer = BaselineOptimizer(host, host.port_factory.get( | 102 baseline_optimizer = BaselineOptimizer(host, host.port_factory.get( |
| 103 ), host.port_factory.all_port_names()) | 103 ), host.port_factory.all_port_names()) |
| 104 self.assertTrue(baseline_optimizer.optimize(fs.join(baseline_dirname, ba
seline_name))) | 104 self.assertTrue(baseline_optimizer.optimize(fs.join(baseline_dirname, ba
seline_name))) |
| 105 | 105 |
| 106 for dirname, contents in expected_new_results_by_directory.items(): | 106 for dirname, contents in expected_new_results_by_directory.items(): |
| 107 path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) | 107 path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) |
| 108 if contents is not None: | 108 if contents is not None: |
| 109 self.assertEqual(fs.read_binary_file(path), contents) | 109 self.assertEqual(fs.read_binary_file(path), contents) |
| 110 | 110 |
| 111 # Check that the files that were in the original set have been deleted w
here necessary. |
| 112 for dirname in results_by_directory: |
| 113 path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) |
| 114 if dirname not in expected_new_results_by_directory: |
| 115 self.assertFalse(fs.exists(path)) |
| 116 |
| 111 def test_linux_redundant_with_win(self): | 117 def test_linux_redundant_with_win(self): |
| 112 self._assertOptimization( | 118 self._assertOptimization( |
| 113 { | 119 { |
| 114 'platform/win': '1', | 120 'platform/win': '1', |
| 115 'platform/linux': '1', | 121 'platform/linux': '1', |
| 116 }, | 122 }, |
| 117 { | 123 { |
| 118 'platform/win': '1', | 124 'platform/win': '1', |
| 119 }) | 125 }) |
| 120 | 126 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 'platform/mac': '1', | 159 'platform/mac': '1', |
| 154 'platform/linux': '1', | 160 'platform/linux': '1', |
| 155 '': '2', | 161 '': '2', |
| 156 }) | 162 }) |
| 157 | 163 |
| 158 def test_local_optimization(self): | 164 def test_local_optimization(self): |
| 159 self._assertOptimization( | 165 self._assertOptimization( |
| 160 { | 166 { |
| 161 'platform/mac': '1', | 167 'platform/mac': '1', |
| 162 'platform/linux': '1', | 168 'platform/linux': '1', |
| 163 'platform/linux-precise': '1', | 169 'platform/android': '1', |
| 164 }, | 170 }, |
| 165 { | 171 { |
| 166 'platform/mac': '1', | 172 'platform/mac': '1', |
| 167 'platform/linux': '1', | 173 'platform/linux': '1', |
| 168 }) | 174 }) |
| 169 | 175 |
| 170 def test_local_optimization_skipping_a_port_in_the_middle(self): | 176 def test_local_optimization_skipping_a_port_in_the_middle(self): |
| 171 self._assertOptimization( | 177 self._assertOptimization( |
| 172 { | 178 { |
| 173 'platform/mac-snowleopard': '1', | 179 'platform/mac-snowleopard': '1', |
| 174 'platform/win': '1', | 180 'platform/win': '1', |
| 175 'platform/linux': '1', | 181 'platform/linux': '1', |
| 176 'platform/linux-precise': '1', | 182 'platform/android': '1', |
| 177 }, | 183 }, |
| 178 { | 184 { |
| 179 'platform/mac-snowleopard': '1', | 185 'platform/mac-snowleopard': '1', |
| 180 'platform/win': '1', | 186 'platform/win': '1', |
| 181 }) | 187 }) |
| 182 | 188 |
| 183 def test_baseline_redundant_with_root(self): | 189 def test_baseline_redundant_with_root(self): |
| 184 self._assertOptimization( | 190 self._assertOptimization( |
| 185 { | 191 { |
| 186 'platform/mac': '1', | 192 'platform/mac': '1', |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 self._assertOptimization( | 277 self._assertOptimization( |
| 272 { | 278 { |
| 273 'virtual/gpu/fast/canvas': '2', | 279 'virtual/gpu/fast/canvas': '2', |
| 274 'platform/mac/fast/canvas': '1', | 280 'platform/mac/fast/canvas': '1', |
| 275 }, | 281 }, |
| 276 { | 282 { |
| 277 'virtual/gpu/fast/canvas': '2', | 283 'virtual/gpu/fast/canvas': '2', |
| 278 'platform/mac/fast/canvas': '1', | 284 'platform/mac/fast/canvas': '1', |
| 279 }, | 285 }, |
| 280 baseline_dirname='virtual/gpu/fast/canvas') | 286 baseline_dirname='virtual/gpu/fast/canvas') |
| 287 |
| 288 def test_virtual_redundant_with_actual(self): |
| 289 self._assertOptimization( |
| 290 { |
| 291 'platform/mac/virtual/gpu/fast/canvas': '1', |
| 292 'platform/mac/fast/canvas': '1', |
| 293 }, |
| 294 { |
| 295 'platform/mac/fast/canvas': '1', |
| 296 }, |
| 297 baseline_dirname='virtual/gpu/fast/canvas') |
| OLD | NEW |