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

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

Issue 2672803002: [Telemetry refactor] Migrate clients to new JavaScript API (batch 3) (Closed)
Patch Set: add comment on tools/android Created 3 years, 10 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
Index: content/test/gpu/gpu_tests/gpu_process_integration_test.py
diff --git a/content/test/gpu/gpu_tests/gpu_process_integration_test.py b/content/test/gpu/gpu_tests/gpu_process_integration_test.py
index 89691eda838269eccba0a3f3697094bb70fda2f0..adf3878986de692f915bc44d2a1e2eb6e142fbb4 100644
--- a/content/test/gpu/gpu_tests/gpu_process_integration_test.py
+++ b/content/test/gpu/gpu_tests/gpu_process_integration_test.py
@@ -142,24 +142,22 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
def _NavigateAndWait(self, test_path):
self._Navigate(test_path)
- self.tab.action_runner.WaitForJavaScriptCondition(
- 'window.domAutomationController._finished', timeout_in_seconds=10)
+ self.tab.action_runner.WaitForJavaScriptCondition2(
+ 'window.domAutomationController._finished', timeout=10)
def _VerifyGpuProcessPresent(self):
tab = self.tab
- has_gpu_channel_js = 'chrome.gpuBenchmarking.hasGpuChannel()'
- has_gpu_channel = tab.EvaluateJavaScript(has_gpu_channel_js)
- if not has_gpu_channel:
+ if not tab.EvaluateJavaScript2('chrome.gpuBenchmarking.hasGpuChannel()'):
self.fail('No GPU channel detected')
def _ValidateDriverBugWorkaroundsImpl(self, process_kind, is_expected,
workaround_name):
tab = self.tab
if process_kind == "browser_process":
- gpu_driver_bug_workarounds = tab.EvaluateJavaScript(
+ gpu_driver_bug_workarounds = tab.EvaluateJavaScript2(
'GetDriverBugWorkarounds()')
elif process_kind == "gpu_process":
- gpu_driver_bug_workarounds = tab.EvaluateJavaScript(
+ gpu_driver_bug_workarounds = tab.EvaluateJavaScript2(
'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
is_present = workaround_name in gpu_driver_bug_workarounds
@@ -173,7 +171,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
if failure:
print 'Test failed. Printing page contents:'
- print tab.EvaluateJavaScript('document.body.innerHTML')
+ print tab.EvaluateJavaScript2('document.body.innerHTML')
self.fail('%s %s in %s workarounds: %s'
% (workaround_name, error_message, process_kind,
gpu_driver_bug_workarounds))
@@ -201,27 +199,25 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
def _CompareAndCaptureDriverBugWorkarounds(self):
tab = self.tab
- has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()'
- if not tab.EvaluateJavaScript(has_gpu_process_js):
+ if not tab.EvaluateJavaScript2('chrome.gpuBenchmarking.hasGpuProcess()'):
self.fail('No GPU process detected')
- has_gpu_channel_js = 'chrome.gpuBenchmarking.hasGpuChannel()'
- if not tab.EvaluateJavaScript(has_gpu_channel_js):
+ if not tab.EvaluateJavaScript2('chrome.gpuBenchmarking.hasGpuChannel()'):
self.fail('No GPU channel detected')
- browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()')
- gpu_list = tab.EvaluateJavaScript(
+ browser_list = tab.EvaluateJavaScript2('GetDriverBugWorkarounds()')
+ gpu_list = tab.EvaluateJavaScript2(
'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
diff = set(browser_list).symmetric_difference(set(gpu_list))
if len(diff) > 0:
print 'Test failed. Printing page contents:'
- print tab.EvaluateJavaScript('document.body.innerHTML')
+ print tab.EvaluateJavaScript2('document.body.innerHTML')
self.fail('Browser and GPU process list of driver bug'
'workarounds are not equal: %s != %s, diff: %s' %
(browser_list, gpu_list, list(diff)))
- basic_infos = tab.EvaluateJavaScript('browserBridge.gpuInfo.basic_info')
+ basic_infos = tab.EvaluateJavaScript2('browserBridge.gpuInfo.basic_info')
disabled_gl_extensions = None
for info in basic_infos:
if info['description'].startswith('Disabled Extensions'):
@@ -233,7 +229,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
def _VerifyActiveAndInactiveGPUs(
self, expected_active_gpu, expected_inactive_gpus):
tab = self.tab
- basic_infos = tab.EvaluateJavaScript('browserBridge.gpuInfo.basic_info')
+ basic_infos = tab.EvaluateJavaScript2('browserBridge.gpuInfo.basic_info')
active_gpu = []
inactive_gpus = []
index = 0
@@ -321,9 +317,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
'--gpu-testing-vendor-id=0x8086',
'--gpu-testing-device-id=0x0116'])
self._Navigate(test_path)
- has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()'
- has_gpu_process = self.tab.EvaluateJavaScript(has_gpu_process_js)
- if has_gpu_process:
+ if self.tab.EvaluateJavaScript2('chrome.gpuBenchmarking.hasGpuProcess()'):
self.fail('GPU process detected')
def _GpuProcess_driver_bug_workarounds_in_gpu_process(self, test_path):
@@ -347,8 +341,8 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
'on llvmpipe (LLVM 3.4, 256 bits)',
'--gpu-testing-gl-version="3.0 Mesa 11.2"'])
self._Navigate(test_path)
- feature_status_js = 'browserBridge.gpuInfo.featureStatus.featureStatus'
- feature_status_list = self.tab.EvaluateJavaScript(feature_status_js)
+ feature_status_list = self.tab.EvaluateJavaScript2(
+ 'browserBridge.gpuInfo.featureStatus.featureStatus')
result = True
for name, status in feature_status_list.items():
if name == 'multiple_raster_threads':
@@ -442,14 +436,14 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
tab = self.tab
if len(diff) > 0:
print 'Test failed. Printing page contents:'
- print tab.EvaluateJavaScript('document.body.innerHTML')
+ print tab.EvaluateJavaScript2('document.body.innerHTML')
self.fail(
'GPU process and expected list of driver bug '
'workarounds are not equal: %s != %s, diff: %s' %
(recorded_workarounds, new_workarounds, list(diff)))
if recorded_disabled_gl_extensions != new_disabled_gl_extensions:
print 'Test failed. Printing page contents:'
- print tab.EvaluateJavaScript('document.body.innerHTML')
+ print tab.EvaluateJavaScript2('document.body.innerHTML')
self.fail(
'The expected disabled gl extensions are '
'incorrect: %s != %s:' %
@@ -460,9 +454,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
'--disable-gpu',
'--skip-gpu-data-loading'])
self._Navigate(test_path)
- has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()'
- has_gpu_process = self.tab.EvaluateJavaScript(has_gpu_process_js)
- if has_gpu_process:
+ if self.tab.EvaluateJavaScript2('chrome.gpuBenchmarking.hasGpuProcess()'):
self.fail('GPU process detected')
def _GpuProcess_identify_active_gpu1(self, test_path):

Powered by Google App Engine
This is Rietveld 408576698