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

Unified Diff: content/test/gpu/gpu_tests/webgl_debug_renderer_info.py

Issue 48113021: Expose WebGL extension WEBGL_debug_renderer_info to Google domains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding tests Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/data/gpu/webgl_debug_renderer_info.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/gpu/gpu_tests/webgl_debug_renderer_info.py
diff --git a/content/test/gpu/gpu_tests/webgl_debug_renderer_info.py b/content/test/gpu/gpu_tests/webgl_debug_renderer_info.py
new file mode 100644
index 0000000000000000000000000000000000000000..9dba4022e5fc72ecab2adfa8e14b6bd35120b4fb
--- /dev/null
+++ b/content/test/gpu/gpu_tests/webgl_debug_renderer_info.py
@@ -0,0 +1,85 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import os
+import optparse
+
+from telemetry import test as test_module
+from telemetry.core import util
+from telemetry.page import page_set
+from telemetry.page import page_test
+
+data_path = os.path.join(
+ util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
+
+wait_timeout = 20 # seconds
bajones 2013/10/31 00:04:49 wait_timeout not used. Please remove it.
Zhenyao Mo 2013/10/31 00:26:13 Done.
+
+harness_script = r"""
+ var domAutomationController = {};
+
+ domAutomationController._succeeded = false;
+
+ domAutomationController.setAutomationId = function(id) {}
+
+ domAutomationController.send = function(msg) {
+ msg = msg.toLowerCase()
+ if (msg == "success")
+ domAutomationController._succeeded = true;
+ else
+ domAutomationController._succeeded = false;
+ }
+
+ window.domAutomationController = domAutomationController;
+ console.log("Harness injected.");
bajones 2013/10/31 00:04:49 Please remove this console.log.
Zhenyao Mo 2013/10/31 00:26:13 Done.
+"""
+
+class _WebGLDebugRendererInfoValidator(page_test.PageTest):
+ def __init__(self):
+ super(_WebGLDebugRendererInfoValidator, self).__init__('ValidatePage')
+
+ def CustomizeBrowserOptions(self, options):
+ chrome_finch_option = options.finch_option
+ if options.finch_option == "bypassed":
+ chrome_finch_option = "enabled"
+ options.AppendExtraBrowserArgs(
+ '--force-fieldtrials=WebGLDebugRendererInfo/%s/' %
+ chrome_finch_option)
+ options.AppendExtraBrowserArgs('--google-base-url=http://127.0.0.1')
+ if options.finch_option == "bypassed":
+ options.AppendExtraBrowserArgs('--disable-webgl-debug-renderer-info')
bajones 2013/10/31 00:04:49 Nit: Since the order of the browser args doesn't m
Zhenyao Mo 2013/10/31 00:26:13 Done.
+
+ def ValidatePage(self, page, tab, results):
+ if not tab.EvaluateJavaScript('window.domAutomationController._succeeded'):
+ raise page_test.Failure('Test failed')
+
+class WebGLDebugRendererInfo(test_module.Test):
+ enabled = True
bajones 2013/10/31 00:04:49 Nit: This enabled=True is not necessary. Remove it
Zhenyao Mo 2013/10/31 00:26:13 Done.
+ test = _WebGLDebugRendererInfoValidator
+
+ @staticmethod
+ def AddTestCommandLineOptions(parser):
+ group = optparse.OptionGroup(parser, 'WebGL conformance options')
bajones 2013/10/31 00:04:49 Give the options group a better name. "Finch exper
Zhenyao Mo 2013/10/31 00:26:13 Done.
+ group.add_option('--finch-option',
+ help='Enable or disable WebGLDebugRendererInfo finch experiment',
bajones 2013/10/31 00:04:49 Would it be more helpful to have this read "Enable
Zhenyao Mo 2013/10/31 00:26:13 Done.
+ default='enabled')
+ parser.add_option_group(group)
+
+ def CreatePageSet(self, options):
+ page_set_dict = {
+ 'description': 'Test cases for WEBGL_debug_renderer_info extension',
+ 'user_agent_type': 'desktop',
+ 'serving_dirs': [''],
+ 'pages': [
+ {
+ 'name': 'WEBGL_debug_render_info.%s' %
+ options.finch_option,
+ 'url': 'file://webgl_debug_renderer_info.html?query=%s' %
+ options.finch_option,
+ 'script_to_evaluate_on_commit': harness_script,
+ 'navigate_steps': [
+ { 'action': 'navigate' }
+ ]
+ }
+ ]
+ }
+ return page_set.PageSet.FromDict(page_set_dict, data_path)
« no previous file with comments | « content/test/data/gpu/webgl_debug_renderer_info.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698