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

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

Issue 337603005: Rename telemetry.test.Test to telemetry.benchmark.Benchmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/test/gpu/gpu_tests/pixel.py ('k') | content/test/gpu/gpu_tests/webgl_conformance.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 test 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 # pylint: disable=W0401,W0614 13 # pylint: disable=W0401,W0614
14 from telemetry.page.actions.all_page_actions import * 14 from telemetry.page.actions.all_page_actions import *
15 15
16 data_path = os.path.join( 16 data_path = os.path.join(
17 util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') 17 util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
18 18
19 @test.Disabled('mac') 19 @benchmark.Disabled('mac')
20 class _ScreenshotSyncValidator(page_test.PageTest): 20 class _ScreenshotSyncValidator(page_test.PageTest):
21 def CustomizeBrowserOptions(self, options): 21 def CustomizeBrowserOptions(self, options):
22 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 22 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
23 23
24 def ValidatePage(self, page, tab, results): 24 def ValidatePage(self, page, tab, results):
25 test_success = tab.EvaluateJavaScript('window.__testSuccess') 25 test_success = tab.EvaluateJavaScript('window.__testSuccess')
26 if not test_success: 26 if not test_success:
27 message = tab.EvaluateJavaScript('window.__testMessage') 27 message = tab.EvaluateJavaScript('window.__testMessage')
28 raise page_test.Failure(message) 28 raise page_test.Failure(message)
29 29
30 30
31 @test.Disabled('mac') 31 @benchmark.Disabled('mac')
32 class ScreenshotSyncPage(page.Page): 32 class ScreenshotSyncPage(page.Page):
33 def __init__(self, page_set, base_dir): 33 def __init__(self, page_set, base_dir):
34 super(ScreenshotSyncPage, self).__init__( 34 super(ScreenshotSyncPage, self).__init__(
35 url='file://screenshot_sync.html', 35 url='file://screenshot_sync.html',
36 page_set=page_set, 36 page_set=page_set,
37 base_dir=base_dir, 37 base_dir=base_dir,
38 name='ScreenshotSync') 38 name='ScreenshotSync')
39 self.user_agent_type = 'desktop' 39 self.user_agent_type = 'desktop'
40 40
41 def RunNavigateSteps(self, action_runner): 41 def RunNavigateSteps(self, action_runner):
42 action_runner.NavigateToPage(self) 42 action_runner.NavigateToPage(self)
43 action_runner.WaitForJavaScriptCondition( 43 action_runner.WaitForJavaScriptCondition(
44 'window.__testComplete', timeout_in_seconds=120) 44 'window.__testComplete', timeout_in_seconds=120)
45 45
46 46
47 @test.Disabled('mac') 47 @benchmark.Disabled('mac')
48 class ScreenshotSyncProcess(test.Test): 48 class ScreenshotSyncProcess(benchmark.Benchmark):
49 """Tests that screenhots are properly synchronized with the frame one which 49 """Tests that screenhots are properly synchronized with the frame one which
50 they were requested""" 50 they were requested"""
51 test = _ScreenshotSyncValidator 51 test = _ScreenshotSyncValidator
52 52
53 def CreateExpectations(self, page_set): 53 def CreateExpectations(self, page_set):
54 return expectations.ScreenshotSyncExpectations() 54 return expectations.ScreenshotSyncExpectations()
55 55
56 def CreatePageSet(self, options): 56 def CreatePageSet(self, options):
57 ps = page_set.PageSet(file_path=data_path, serving_dirs=['']) 57 ps = page_set.PageSet(file_path=data_path, serving_dirs=[''])
58 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir)) 58 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir))
59 return ps 59 return ps
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/pixel.py ('k') | content/test/gpu/gpu_tests/webgl_conformance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698