OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import sys | 6 import sys |
7 import time | 7 import time |
8 | 8 |
9 from gpu_tests import gpu_integration_test | 9 from gpu_tests import gpu_integration_test |
10 from gpu_tests import context_lost_expectations | 10 from gpu_tests import context_lost_expectations |
11 from gpu_tests import path_util | 11 from gpu_tests import path_util |
12 | 12 |
13 from telemetry.core import exceptions | 13 from telemetry.core import exceptions |
14 | 14 |
15 data_path = os.path.join( | 15 data_path = os.path.join( |
16 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') | 16 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') |
17 | 17 |
18 wait_timeout = 60 # seconds | 18 wait_timeout = 60 # seconds |
19 | 19 |
20 harness_script = r""" | 20 harness_script = r""" |
21 var domAutomationController = {}; | 21 var domAutomationController = {}; |
22 | 22 |
23 domAutomationController._loaded = false; | 23 domAutomationController._loaded = false; |
24 domAutomationController._succeeded = false; | 24 domAutomationController._succeeded = false; |
25 domAutomationController._finished = false; | 25 domAutomationController._finished = false; |
26 | 26 |
27 domAutomationController.setAutomationId = function(id) {} | |
28 | |
29 domAutomationController.send = function(msg) { | 27 domAutomationController.send = function(msg) { |
30 msg = msg.toLowerCase() | 28 msg = msg.toLowerCase() |
31 if (msg == "loaded") { | 29 if (msg == "loaded") { |
32 domAutomationController._loaded = true; | 30 domAutomationController._loaded = true; |
33 } else if (msg == "success") { | 31 } else if (msg == "success") { |
34 /* Don't squelch earlier failures! */ | 32 /* Don't squelch earlier failures! */ |
35 if (!domAutomationController._finished) { | 33 if (!domAutomationController._finished) { |
36 domAutomationController._succeeded = true; | 34 domAutomationController._succeeded = true; |
37 } | 35 } |
38 domAutomationController._finished = true; | 36 domAutomationController._finished = true; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 # doesn't crash. | 244 # doesn't crash. |
247 tab = self.tab | 245 tab = self.tab |
248 dummy_tab = tab.browser.tabs.New() | 246 dummy_tab = tab.browser.tabs.New() |
249 tab.EvaluateJavaScript('loseContextUsingExtension()') | 247 tab.EvaluateJavaScript('loseContextUsingExtension()') |
250 tab.Activate() | 248 tab.Activate() |
251 self._WaitForTabAndCheckCompletion() | 249 self._WaitForTabAndCheckCompletion() |
252 | 250 |
253 def load_tests(loader, tests, pattern): | 251 def load_tests(loader, tests, pattern): |
254 del loader, tests, pattern # Unused. | 252 del loader, tests, pattern # Unused. |
255 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) | 253 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) |
OLD | NEW |