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

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

Issue 411143003: Add an "in_unit_test_mode" attribute to the environment. Use this to default output format to 'gtes… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comment. Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import os 4 import os
5 5
6 import screenshot_sync_expectations as expectations 6 import screenshot_sync_expectations as expectations
7 7
8 from telemetry import benchmark 8 from telemetry import benchmark
9 from telemetry.core import util 9 from telemetry.core import util
10 from telemetry.page import page 10 from telemetry.page import page
11 from telemetry.page import page_set 11 from telemetry.page import page_set
12 from telemetry.page import page_test 12 from telemetry.page import page_test
13 13
14 data_path = os.path.join( 14 data_path = os.path.join(
15 util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') 15 util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
16 16
17 @benchmark.Disabled('mac') 17 @benchmark.Disabled('mac')
18 class _ScreenshotSyncValidator(page_test.PageTest): 18 class _ScreenshotSyncValidator(page_test.PageTest):
19 options = {'output_format': 'gtest'}
20
19 def CustomizeBrowserOptions(self, options): 21 def CustomizeBrowserOptions(self, options):
20 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 22 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
21 23
22 def ValidatePage(self, page, tab, results): 24 def ValidatePage(self, page, tab, results):
23 test_success = tab.EvaluateJavaScript('window.__testSuccess') 25 test_success = tab.EvaluateJavaScript('window.__testSuccess')
24 if not test_success: 26 if not test_success:
25 message = tab.EvaluateJavaScript('window.__testMessage') 27 message = tab.EvaluateJavaScript('window.__testMessage')
26 raise page_test.Failure(message) 28 raise page_test.Failure(message)
27 29
28 30
(...skipping 19 matching lines...) Expand all
48 they were requested""" 50 they were requested"""
49 test = _ScreenshotSyncValidator 51 test = _ScreenshotSyncValidator
50 52
51 def CreateExpectations(self, page_set): 53 def CreateExpectations(self, page_set):
52 return expectations.ScreenshotSyncExpectations() 54 return expectations.ScreenshotSyncExpectations()
53 55
54 def CreatePageSet(self, options): 56 def CreatePageSet(self, options):
55 ps = page_set.PageSet(file_path=data_path, serving_dirs=['']) 57 ps = page_set.PageSet(file_path=data_path, serving_dirs=[''])
56 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir)) 58 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir))
57 return ps 59 return ps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698