| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 self.assertEqual(baseline_optimizer._files_to_delete, [ | 108 self.assertEqual(baseline_optimizer._files_to_delete, [ |
| 109 '/mock-checkout/third_party/WebKit/LayoutTests/platform/win/another/
test-expected.txt', | 109 '/mock-checkout/third_party/WebKit/LayoutTests/platform/win/another/
test-expected.txt', |
| 110 ]) | 110 ]) |
| 111 | 111 |
| 112 self.assertEqual(baseline_optimizer._files_to_add, [ | 112 self.assertEqual(baseline_optimizer._files_to_add, [ |
| 113 '/mock-checkout/third_party/WebKit/LayoutTests/another/test-expected
.txt', | 113 '/mock-checkout/third_party/WebKit/LayoutTests/another/test-expected
.txt', |
| 114 '/mock-checkout/third_party/WebKit/LayoutTests/platform/linux/anothe
r/test-expected.txt', | 114 '/mock-checkout/third_party/WebKit/LayoutTests/platform/linux/anothe
r/test-expected.txt', |
| 115 ]) | 115 ]) |
| 116 | 116 |
| 117 def _assertOptimization(self, results_by_directory, expected_new_results_by_
directory, baseline_dirname='', expected_files_to_delete=None, host=None): | 117 def _assertOptimization(self, results_by_directory, expected_new_results_by_
directory, |
| 118 baseline_dirname='', expected_files_to_delete=None,
host=None): |
| 118 if not host: | 119 if not host: |
| 119 host = MockHost() | 120 host = MockHost() |
| 120 fs = host.filesystem | 121 fs = host.filesystem |
| 121 webkit_base = WebKitFinder(fs).webkit_base() | 122 webkit_base = WebKitFinder(fs).webkit_base() |
| 122 baseline_name = 'mock-baseline-expected.txt' | 123 baseline_name = 'mock-baseline-expected.txt' |
| 123 fs.write_text_file(fs.join(webkit_base, 'LayoutTests', 'VirtualTestSuite
s'), | 124 fs.write_text_file(fs.join(webkit_base, 'LayoutTests', 'VirtualTestSuite
s'), |
| 124 '[{"prefix": "gpu", "base": "fast/canvas", "args": ["
--foo"]}]') | 125 '[{"prefix": "gpu", "base": "fast/canvas", "args": ["
--foo"]}]') |
| 125 | 126 |
| 126 for dirname, contents in results_by_directory.items(): | 127 for dirname, contents in results_by_directory.items(): |
| 127 path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) | 128 path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 host=MockHost(scm=ExcludingMockSCM(['/mock-checkout/third_party/WebK
it/LayoutTests/virtual/gpu/fast/canvas/mock-baseline-expected.txt']))) | 289 host=MockHost(scm=ExcludingMockSCM(['/mock-checkout/third_party/WebK
it/LayoutTests/virtual/gpu/fast/canvas/mock-baseline-expected.txt']))) |
| 289 | 290 |
| 290 def test_virtual_root_not_redundant_with_ancestors(self): | 291 def test_virtual_root_not_redundant_with_ancestors(self): |
| 291 self._assertOptimization({ | 292 self._assertOptimization({ |
| 292 'virtual/gpu/fast/canvas': '2', | 293 'virtual/gpu/fast/canvas': '2', |
| 293 'platform/mac/fast/canvas': '1', | 294 'platform/mac/fast/canvas': '1', |
| 294 }, { | 295 }, { |
| 295 'virtual/gpu/fast/canvas': '2', | 296 'virtual/gpu/fast/canvas': '2', |
| 296 'platform/mac/fast/canvas': '1', | 297 'platform/mac/fast/canvas': '1', |
| 297 }, baseline_dirname='virtual/gpu/fast/canvas') | 298 }, baseline_dirname='virtual/gpu/fast/canvas') |
| OLD | NEW |