Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: content/test/gpu/gpu_tests/gpu_process.py

Issue 1463823002: Add DriverBugWorkaroundsInGpuProcessPage to gpu_process_test.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a testing GpuChannelMsg_GetDriverBugWorkArounds IPC message and use it in a new browser test Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 from gpu_tests import gpu_process_expectations as expectations 4 from gpu_tests import gpu_process_expectations as expectations
5 from gpu_tests import gpu_test_base 5 from gpu_tests import gpu_test_base
6 import page_sets 6 import page_sets
7 7
8 from telemetry.page import page_test 8 from telemetry.page import page_test
9 9
10 test_harness_script = r""" 10 test_harness_script = r"""
11 var domAutomationController = {}; 11 var domAutomationController = {};
12 domAutomationController._finished = false; 12 domAutomationController._finished = false;
13 domAutomationController.setAutomationId = function(id) {} 13 domAutomationController.setAutomationId = function(id) {}
14 domAutomationController.send = function(msg) { 14 domAutomationController.send = function(msg) {
15 domAutomationController._finished = true; 15 domAutomationController._finished = true;
16 } 16 }
17 17
18 window.domAutomationController = domAutomationController; 18 window.domAutomationController = domAutomationController;
19
20 function VerifyDriverBugWorkarounds(workaround) {
Ken Russell (switch to Gerrit) 2016/03/30 22:17:41 nit: VerifyDriverBugWorkaroundIsPresent
Julien Isorce Samsung 2016/03/31 15:20:09 Done.
21 var browser_list = document.querySelector('.workarounds-list');
22 var gpu_list = chrome.gpuBenchmarking.getGpuDriverBugWorkarounds();
23 var found = false;
24
25 for (var i=0; i < browser_list.childElementCount; i++) {
26 var workaround_str = browser_list.children[i].textContent;
27 if (gpu_list.indexOf(workaround_str) < 0)
28 return false;
29
30 if (!found && workaround_str == workaround)
31 found = true;
32 }
33
34 return found;
35 };
19 """ 36 """
20 37
21 class GpuProcessValidator(gpu_test_base.ValidatorBase): 38 class GpuProcessValidator(gpu_test_base.ValidatorBase):
22 def __init__(self): 39 def __init__(self):
23 super(GpuProcessValidator, self).__init__( 40 super(GpuProcessValidator, self).__init__(
24 needs_browser_restart_after_each_page=True) 41 needs_browser_restart_after_each_page=True)
25 42
26 def CustomizeBrowserOptions(self, options): 43 def CustomizeBrowserOptions(self, options):
27 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 44 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
28 45
(...skipping 15 matching lines...) Expand all
44 return 'gpu_process' 61 return 'gpu_process'
45 62
46 def _CreateExpectations(self): 63 def _CreateExpectations(self):
47 return expectations.GpuProcessExpectations() 64 return expectations.GpuProcessExpectations()
48 65
49 def CreateStorySet(self, options): 66 def CreateStorySet(self, options):
50 story_set = page_sets.GpuProcessTestsStorySet(self.GetExpectations()) 67 story_set = page_sets.GpuProcessTestsStorySet(self.GetExpectations())
51 for page in story_set: 68 for page in story_set:
52 page.script_to_evaluate_on_commit = test_harness_script 69 page.script_to_evaluate_on_commit = test_harness_script
53 return story_set 70 return story_set
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698