Commit 1eaf2fbd authored by rnephew's avatar rnephew Committed by Commit Bot

[Telemetry] Get rid of last references to benchmark.Enabled/Disabled

For benchmarks, this means moving to expectations. For unit tests this
means moving to decorators.Enabled()/Disabled()

TBR=bustamante@chromium.org

Bug: 713222
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester
Change-Id: Ia67b2ce6734740770d33d012f7b557879c47321d
Reviewed-on: https://chromium-review.googlesource.com/663664
Commit-Queue: rnephew <rnephew@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Reviewed-by: default avatarPaul Jensen <pauljensen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503550}
parent dac9751b
...@@ -206,10 +206,10 @@ class CronetPerfTestMeasurement( ...@@ -206,10 +206,10 @@ class CronetPerfTestMeasurement(
'ms', jsonResults[test])) 'ms', jsonResults[test]))
@benchmark.Enabled('android')
class CronetPerfTestBenchmark(benchmark.Benchmark): class CronetPerfTestBenchmark(benchmark.Benchmark):
# Benchmark implementation spawning off Cronet perf test measurement and # Benchmark implementation spawning off Cronet perf test measurement and
# StorySet. # StorySet.
SUPPORTED_PLATFORMS = [story.expectations.ALL_ANDROID]
def __init__(self, max_failures=None): def __init__(self, max_failures=None):
super(CronetPerfTestBenchmark, self).__init__(max_failures) super(CronetPerfTestBenchmark, self).__init__(max_failures)
...@@ -221,6 +221,12 @@ class CronetPerfTestBenchmark(benchmark.Benchmark): ...@@ -221,6 +221,12 @@ class CronetPerfTestBenchmark(benchmark.Benchmark):
def CreateStorySet(self, options): def CreateStorySet(self, options):
return CronetPerfTestStorySet(self._device) return CronetPerfTestStorySet(self._device)
def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self):
pass # Nothing disabled.
return StoryExpectations()
class QuicServer(object): class QuicServer(object):
......
...@@ -6,6 +6,7 @@ from common.chrome_proxy_benchmark import ChromeProxyBenchmark ...@@ -6,6 +6,7 @@ from common.chrome_proxy_benchmark import ChromeProxyBenchmark
from integration_tests import chrome_proxy_measurements as measurements from integration_tests import chrome_proxy_measurements as measurements
from integration_tests import chrome_proxy_pagesets as pagesets from integration_tests import chrome_proxy_pagesets as pagesets
from telemetry import benchmark from telemetry import benchmark
from telemetry import decorators
DESKTOP_PLATFORMS = ['mac', 'linux', 'win', 'chromeos'] DESKTOP_PLATFORMS = ['mac', 'linux', 'win', 'chromeos']
WEBVIEW_PLATFORMS = ['android-webview', 'android-webview-instrumentation'] WEBVIEW_PLATFORMS = ['android-webview', 'android-webview-instrumentation']
...@@ -49,7 +50,7 @@ class ChromeProxyClientType(ChromeProxyBenchmark): ...@@ -49,7 +50,7 @@ class ChromeProxyClientType(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.client_type.client_type' return 'chrome_proxy_benchmark.client_type.client_type'
@benchmark.Disabled(*WEBVIEW_PLATFORMS) @decorators.Disabled(*WEBVIEW_PLATFORMS)
class ChromeProxyLoFi(ChromeProxyBenchmark): class ChromeProxyLoFi(ChromeProxyBenchmark):
tag = 'lo_fi' tag = 'lo_fi'
test = measurements.ChromeProxyLoFi test = measurements.ChromeProxyLoFi
...@@ -60,7 +61,7 @@ class ChromeProxyLoFi(ChromeProxyBenchmark): ...@@ -60,7 +61,7 @@ class ChromeProxyLoFi(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.lo_fi.lo_fi' return 'chrome_proxy_benchmark.lo_fi.lo_fi'
@benchmark.Disabled(*WEBVIEW_PLATFORMS) @decorators.Disabled(*WEBVIEW_PLATFORMS)
class ChromeProxyCacheLoFiDisabled(ChromeProxyBenchmark): class ChromeProxyCacheLoFiDisabled(ChromeProxyBenchmark):
tag = 'cache_lo_fi_disabled' tag = 'cache_lo_fi_disabled'
test = measurements.ChromeProxyCacheLoFiDisabled test = measurements.ChromeProxyCacheLoFiDisabled
...@@ -71,7 +72,7 @@ class ChromeProxyCacheLoFiDisabled(ChromeProxyBenchmark): ...@@ -71,7 +72,7 @@ class ChromeProxyCacheLoFiDisabled(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.lo_fi.cache_lo_fi_disabled' return 'chrome_proxy_benchmark.lo_fi.cache_lo_fi_disabled'
@benchmark.Disabled(*WEBVIEW_PLATFORMS) @decorators.Disabled(*WEBVIEW_PLATFORMS)
class ChromeProxyCacheProxyDisabled(ChromeProxyBenchmark): class ChromeProxyCacheProxyDisabled(ChromeProxyBenchmark):
tag = 'cache_proxy_disabled' tag = 'cache_proxy_disabled'
test = measurements.ChromeProxyCacheProxyDisabled test = measurements.ChromeProxyCacheProxyDisabled
...@@ -82,7 +83,7 @@ class ChromeProxyCacheProxyDisabled(ChromeProxyBenchmark): ...@@ -82,7 +83,7 @@ class ChromeProxyCacheProxyDisabled(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.lo_fi.cache_proxy_disabled' return 'chrome_proxy_benchmark.lo_fi.cache_proxy_disabled'
@benchmark.Disabled(*WEBVIEW_PLATFORMS) @decorators.Disabled(*WEBVIEW_PLATFORMS)
class ChromeProxyLitePage(ChromeProxyBenchmark): class ChromeProxyLitePage(ChromeProxyBenchmark):
tag = 'lite_page' tag = 'lite_page'
test = measurements.ChromeProxyLitePage test = measurements.ChromeProxyLitePage
...@@ -143,7 +144,7 @@ class ChromeProxyHTML5Test(ChromeProxyBenchmark): ...@@ -143,7 +144,7 @@ class ChromeProxyHTML5Test(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.html5test.html5test' return 'chrome_proxy_benchmark.html5test.html5test'
@benchmark.Enabled(*DESKTOP_PLATFORMS) @decorators.Enabled(*DESKTOP_PLATFORMS)
class ChromeProxyYouTube(ChromeProxyBenchmark): class ChromeProxyYouTube(ChromeProxyBenchmark):
tag = 'youtube' tag = 'youtube'
test = measurements.ChromeProxyYouTube test = measurements.ChromeProxyYouTube
...@@ -174,7 +175,7 @@ class ChromeProxyBlockOnce(ChromeProxyBenchmark): ...@@ -174,7 +175,7 @@ class ChromeProxyBlockOnce(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.block_once.block_once' return 'chrome_proxy_benchmark.block_once.block_once'
@benchmark.Disabled(*(DESKTOP_PLATFORMS + WEBVIEW_PLATFORMS)) @decorators.Disabled(*(DESKTOP_PLATFORMS + WEBVIEW_PLATFORMS))
# Safebrowsing is enabled for Android and iOS. # Safebrowsing is enabled for Android and iOS.
class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark): class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark):
tag = 'safebrowsing_on' tag = 'safebrowsing_on'
...@@ -191,7 +192,7 @@ class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark): ...@@ -191,7 +192,7 @@ class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing' return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing'
@benchmark.Enabled(*(DESKTOP_PLATFORMS + WEBVIEW_PLATFORMS)) @decorators.Enabled(*(DESKTOP_PLATFORMS + WEBVIEW_PLATFORMS))
# Safebrowsing is switched off for Android Webview and all desktop platforms. # Safebrowsing is switched off for Android Webview and all desktop platforms.
class ChromeProxySafeBrowsingOff(ChromeProxyBenchmark): class ChromeProxySafeBrowsingOff(ChromeProxyBenchmark):
tag = 'safebrowsing_off' tag = 'safebrowsing_off'
...@@ -283,7 +284,7 @@ class ChromeProxyClientConfig(ChromeProxyBenchmark): ...@@ -283,7 +284,7 @@ class ChromeProxyClientConfig(ChromeProxyBenchmark):
return 'chrome_proxy_benchmark.client_config.synthetic' return 'chrome_proxy_benchmark.client_config.synthetic'
@benchmark.Enabled(*DESKTOP_PLATFORMS) @decorators.Enabled(*DESKTOP_PLATFORMS)
class ChromeProxyVideoDirect(benchmark.Benchmark): class ChromeProxyVideoDirect(benchmark.Benchmark):
tag = 'video' tag = 'video'
test = measurements.ChromeProxyVideoValidation test = measurements.ChromeProxyVideoValidation
...@@ -294,7 +295,7 @@ class ChromeProxyVideoDirect(benchmark.Benchmark): ...@@ -294,7 +295,7 @@ class ChromeProxyVideoDirect(benchmark.Benchmark):
return 'chrome_proxy_benchmark.video.direct' return 'chrome_proxy_benchmark.video.direct'
@benchmark.Enabled(*DESKTOP_PLATFORMS) @decorators.Enabled(*DESKTOP_PLATFORMS)
class ChromeProxyVideoProxied(benchmark.Benchmark): class ChromeProxyVideoProxied(benchmark.Benchmark):
tag = 'video' tag = 'video'
test = measurements.ChromeProxyVideoValidation test = measurements.ChromeProxyVideoValidation
...@@ -305,7 +306,7 @@ class ChromeProxyVideoProxied(benchmark.Benchmark): ...@@ -305,7 +306,7 @@ class ChromeProxyVideoProxied(benchmark.Benchmark):
return 'chrome_proxy_benchmark.video.proxied' return 'chrome_proxy_benchmark.video.proxied'
@benchmark.Enabled(*DESKTOP_PLATFORMS) @decorators.Enabled(*DESKTOP_PLATFORMS)
class ChromeProxyVideoCompare(benchmark.Benchmark): class ChromeProxyVideoCompare(benchmark.Benchmark):
"""Comparison of direct and proxied video fetches. """Comparison of direct and proxied video fetches.
...@@ -321,7 +322,7 @@ class ChromeProxyVideoCompare(benchmark.Benchmark): ...@@ -321,7 +322,7 @@ class ChromeProxyVideoCompare(benchmark.Benchmark):
def Name(cls): def Name(cls):
return 'chrome_proxy_benchmark.video.compare' return 'chrome_proxy_benchmark.video.compare'
@benchmark.Enabled(*DESKTOP_PLATFORMS) @decorators.Enabled(*DESKTOP_PLATFORMS)
class ChromeProxyVideoFrames(benchmark.Benchmark): class ChromeProxyVideoFrames(benchmark.Benchmark):
"""Check for video frames similar to original video.""" """Check for video frames similar to original video."""
...@@ -333,7 +334,7 @@ class ChromeProxyVideoFrames(benchmark.Benchmark): ...@@ -333,7 +334,7 @@ class ChromeProxyVideoFrames(benchmark.Benchmark):
def Name(cls): def Name(cls):
return 'chrome_proxy_benchmark.video.frames' return 'chrome_proxy_benchmark.video.frames'
@benchmark.Enabled(*DESKTOP_PLATFORMS) @decorators.Enabled(*DESKTOP_PLATFORMS)
class ChromeProxyVideoAudio(benchmark.Benchmark): class ChromeProxyVideoAudio(benchmark.Benchmark):
"""Check that audio is similar to original video.""" """Check that audio is similar to original video."""
......
...@@ -9,7 +9,6 @@ import os ...@@ -9,7 +9,6 @@ import os
from core import perf_benchmark from core import perf_benchmark
from telemetry import benchmark from telemetry import benchmark
from telemetry import decorators
from telemetry import page as page_module from telemetry import page as page_module
from telemetry.page import legacy_page_test from telemetry.page import legacy_page_test
from telemetry import story from telemetry import story
...@@ -191,8 +190,6 @@ class DromaeoDomCoreQuery(_DromaeoBenchmark): ...@@ -191,8 +190,6 @@ class DromaeoDomCoreQuery(_DromaeoBenchmark):
return StoryExpectations() return StoryExpectations()
# Flaky on Windows: https://crbug.com/763263
@decorators.Disabled('win')
@benchmark.Owner(emails=['jbroman@chromium.org', @benchmark.Owner(emails=['jbroman@chromium.org',
'yukishiino@chromium.org', 'yukishiino@chromium.org',
'haraken@chromium.org']) 'haraken@chromium.org'])
...@@ -211,5 +208,5 @@ class DromaeoDomCoreTraverse(_DromaeoBenchmark): ...@@ -211,5 +208,5 @@ class DromaeoDomCoreTraverse(_DromaeoBenchmark):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # http://dromaeo.com?dom-traverse not disabled. self.DisableBenchmark([story.expectations.ALL_WIN], 'crbug.com/763263')
return StoryExpectations() return StoryExpectations()
...@@ -40,8 +40,6 @@ class _PageCyclerV2(perf_benchmark.PerfBenchmark): ...@@ -40,8 +40,6 @@ class _PageCyclerV2(perf_benchmark.PerfBenchmark):
return False return False
@benchmark.Disabled('win10')
@benchmark.Disabled('android') # crbug.com/654217
@benchmark.Owner(emails=['kouhei@chromium.org', 'ksakamoto@chromium.org']) @benchmark.Owner(emails=['kouhei@chromium.org', 'ksakamoto@chromium.org'])
class PageCyclerV2Typical25(_PageCyclerV2): class PageCyclerV2Typical25(_PageCyclerV2):
"""Page load time benchmark for a 25 typical web pages. """Page load time benchmark for a 25 typical web pages.
...@@ -62,7 +60,7 @@ class PageCyclerV2Typical25(_PageCyclerV2): ...@@ -62,7 +60,7 @@ class PageCyclerV2Typical25(_PageCyclerV2):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # Nothing disabled. pass # Nothing disabled.
return StoryExpectations() return StoryExpectations()
...@@ -85,7 +83,7 @@ class PageCyclerV2IntlArFaHe(_PageCyclerV2): ...@@ -85,7 +83,7 @@ class PageCyclerV2IntlArFaHe(_PageCyclerV2):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # Nothing disabled. pass # Nothing disabled.
return StoryExpectations() return StoryExpectations()
...@@ -108,7 +106,7 @@ class PageCyclerV2IntlEsFrPtBr(_PageCyclerV2): ...@@ -108,7 +106,7 @@ class PageCyclerV2IntlEsFrPtBr(_PageCyclerV2):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # Nothing disabled. pass # Nothing disabled.
return StoryExpectations() return StoryExpectations()
...@@ -131,11 +129,10 @@ class PageCyclerV2IntlHiRu(_PageCyclerV2): ...@@ -131,11 +129,10 @@ class PageCyclerV2IntlHiRu(_PageCyclerV2):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # Nothing disabled. pass # Nothing disabled.
return StoryExpectations() return StoryExpectations()
@benchmark.Disabled('android') # crbug.com/666898
@benchmark.Owner(emails=['kouhei@chromium.org', 'ksakamoto@chromium.org']) @benchmark.Owner(emails=['kouhei@chromium.org', 'ksakamoto@chromium.org'])
class PageCyclerV2IntlJaZh(_PageCyclerV2): class PageCyclerV2IntlJaZh(_PageCyclerV2):
"""Page load time benchmark for a variety of pages in Japanese and Chinese. """Page load time benchmark for a variety of pages in Japanese and Chinese.
...@@ -154,7 +151,7 @@ class PageCyclerV2IntlJaZh(_PageCyclerV2): ...@@ -154,7 +151,7 @@ class PageCyclerV2IntlJaZh(_PageCyclerV2):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # Nothing disabled. pass # Nothing disabled.
return StoryExpectations() return StoryExpectations()
...@@ -177,5 +174,5 @@ class PageCyclerV2IntlKoThVi(_PageCyclerV2): ...@@ -177,5 +174,5 @@ class PageCyclerV2IntlKoThVi(_PageCyclerV2):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # Nothing disabled. pass # Nothing disabled.
return StoryExpectations() return StoryExpectations()
...@@ -15,7 +15,6 @@ from telemetry import story ...@@ -15,7 +15,6 @@ from telemetry import story
@benchmark.Owner(emails=['vovoy@chromium.org'], @benchmark.Owner(emails=['vovoy@chromium.org'],
component='OS>Performance') component='OS>Performance')
@benchmark.Enabled('chromeos')
class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark): class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark):
"""Measures tab switching performance with 24 tabs. """Measures tab switching performance with 24 tabs.
...@@ -31,6 +30,8 @@ class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark): ...@@ -31,6 +30,8 @@ class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark):
cros_tab_switching.typical_24 --tabset-repeat=5 cros_tab_switching.typical_24 --tabset-repeat=5
""" """
test = tab_switching_measure.CrosTabSwitchingMeasurement test = tab_switching_measure.CrosTabSwitchingMeasurement
SUPPORTED_PLATFORMS = [story.expectations.ALL_CHROMEOS]
@classmethod @classmethod
def AddBenchmarkCommandLineArgs(cls, parser): def AddBenchmarkCommandLineArgs(cls, parser):
...@@ -56,5 +57,5 @@ class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark): ...@@ -56,5 +57,5 @@ class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark):
def GetExpectations(self): def GetExpectations(self):
class StoryExpectations(story.expectations.StoryExpectations): class StoryExpectations(story.expectations.StoryExpectations):
def SetExpectations(self): def SetExpectations(self):
pass # No tests disabled. pass # Nothing disabled.
return StoryExpectations() return StoryExpectations()
...@@ -16,7 +16,7 @@ import page_sets ...@@ -16,7 +16,7 @@ import page_sets
from contrib.oilpan import oilpan_gc_times from contrib.oilpan import oilpan_gc_times
@benchmark.Enabled('content-shell')
class OilpanGCTimesBlinkPerfStress(perf_benchmark.PerfBenchmark): class OilpanGCTimesBlinkPerfStress(perf_benchmark.PerfBenchmark):
tag = 'blink_perf_stress' tag = 'blink_perf_stress'
test = oilpan_gc_times.OilpanGCTimesForInternals test = oilpan_gc_times.OilpanGCTimesForInternals
...@@ -52,10 +52,10 @@ class OilpanGCTimesSmoothnessAnimation(perf_benchmark.PerfBenchmark): ...@@ -52,10 +52,10 @@ class OilpanGCTimesSmoothnessAnimation(perf_benchmark.PerfBenchmark):
return StoryExpectations() return StoryExpectations()
@benchmark.Enabled('android')
class OilpanGCTimesKeySilkCases(perf_benchmark.PerfBenchmark): class OilpanGCTimesKeySilkCases(perf_benchmark.PerfBenchmark):
test = oilpan_gc_times.OilpanGCTimesForSmoothness test = oilpan_gc_times.OilpanGCTimesForSmoothness
page_set = page_sets.KeySilkCasesPageSet page_set = page_sets.KeySilkCasesPageSet
SUPPORTED_PLATFORMS = [story.expectations.ALL_ANDROID]
@classmethod @classmethod
def Name(cls): def Name(cls):
...@@ -73,11 +73,11 @@ class OilpanGCTimesKeySilkCases(perf_benchmark.PerfBenchmark): ...@@ -73,11 +73,11 @@ class OilpanGCTimesKeySilkCases(perf_benchmark.PerfBenchmark):
return StoryExpectations() return StoryExpectations()
@benchmark.Enabled('android')
class OilpanGCTimesSyncScrollKeyMobileSites(perf_benchmark.PerfBenchmark): class OilpanGCTimesSyncScrollKeyMobileSites(perf_benchmark.PerfBenchmark):
tag = 'sync_scroll' tag = 'sync_scroll'
test = oilpan_gc_times.OilpanGCTimesForSmoothness test = oilpan_gc_times.OilpanGCTimesForSmoothness
page_set = page_sets.KeyMobileSitesSmoothPageSet page_set = page_sets.KeyMobileSitesSmoothPageSet
SUPPORTED_PLATFORMS = [story.expectations.ALL_ANDROID]
def SetExtraBrowserOptions(self, options): def SetExtraBrowserOptions(self, options):
silk_flags.CustomizeBrowserOptionsForSyncScrolling(options) silk_flags.CustomizeBrowserOptionsForSyncScrolling(options)
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
from core import trybot_command from core import trybot_command
import mock import mock
from telemetry import benchmark from telemetry import benchmark
from telemetry import decorators
class FakeProcess(object): class FakeProcess(object):
...@@ -911,6 +911,7 @@ class TrybotCommandTest(unittest.TestCase): ...@@ -911,6 +911,7 @@ class TrybotCommandTest(unittest.TestCase):
self.assertEquals(output, sys.stdout.getvalue().strip()) self.assertEquals(output, sys.stdout.getvalue().strip())
# TODO(rnephew): Modernize these tests to use StoryExpectations.
class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase): class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase):
def IsBenchmarkDisabled(self, benchmark_class, trybot_name): def IsBenchmarkDisabled(self, benchmark_class, trybot_name):
...@@ -918,7 +919,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase): ...@@ -918,7 +919,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase):
benchmark_class, trybot_name)[0] benchmark_class, trybot_name)[0]
def testBenchmarkIsDisabledAll(self): def testBenchmarkIsDisabledAll(self):
@benchmark.Disabled('all') @decorators.Disabled('all')
class FooBenchmark(benchmark.Benchmark): class FooBenchmark(benchmark.Benchmark):
pass pass
self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'all')) self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'all'))
...@@ -928,7 +929,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase): ...@@ -928,7 +929,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase):
self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati')) self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati'))
def testBenchmarkIsEnabledAll(self): def testBenchmarkIsEnabledAll(self):
@benchmark.Enabled('all') @decorators.Enabled('all')
class FooBenchmark(benchmark.Benchmark): class FooBenchmark(benchmark.Benchmark):
pass pass
self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all')) self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all'))
...@@ -938,7 +939,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase): ...@@ -938,7 +939,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase):
self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati')) self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati'))
def testBenchmarkIsDisabledOnMultiplePlatforms(self): def testBenchmarkIsDisabledOnMultiplePlatforms(self):
@benchmark.Disabled('win', 'mac') @decorators.Disabled('win', 'mac')
class FooBenchmark(benchmark.Benchmark): class FooBenchmark(benchmark.Benchmark):
pass pass
self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all')) self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all'))
...@@ -949,7 +950,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase): ...@@ -949,7 +950,7 @@ class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase):
self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati')) self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati'))
def testBenchmarkIsEnabledOnMultiplePlatforms(self): def testBenchmarkIsEnabledOnMultiplePlatforms(self):
@benchmark.Enabled('win', 'mac') @decorators.Enabled('win', 'mac')
class FooBenchmark(benchmark.Benchmark): class FooBenchmark(benchmark.Benchmark):
pass pass
self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all')) self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all'))
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
from telemetry import benchmark
from telemetry import decorators from telemetry import decorators
from telemetry.testing import tab_test_case from telemetry.testing import tab_test_case
from telemetry.timeline import tracing_config from telemetry.timeline import tracing_config
...@@ -17,7 +16,7 @@ class ClockDomainTest(tab_test_case.TabTestCase): ...@@ -17,7 +16,7 @@ class ClockDomainTest(tab_test_case.TabTestCase):
# Don't run this test on Android; it's not supposed to work on Android # Don't run this test on Android; it's not supposed to work on Android
# (since when doing Android tracing there are two different devices, # (since when doing Android tracing there are two different devices,
# so the clock domains will be different) # so the clock domains will be different)
@benchmark.Disabled('android') @decorators.Disabled('android')
@decorators.Isolated @decorators.Isolated
def testTelemetryUsesChromeClockDomain(self): def testTelemetryUsesChromeClockDomain(self):
......
...@@ -6,7 +6,7 @@ import contextlib ...@@ -6,7 +6,7 @@ import contextlib
from measurements import tab_switching from measurements import tab_switching
import mock import mock
from page_sets.system_health import multi_tab_stories from page_sets.system_health import multi_tab_stories
from telemetry import benchmark from telemetry import decorators
from telemetry import story as story_module from telemetry import story as story_module
from telemetry.internal.results import page_test_results from telemetry.internal.results import page_test_results
from telemetry.testing import page_test_test_case from telemetry.testing import page_test_test_case
...@@ -95,9 +95,9 @@ class TabSwitchingUnittest(page_test_test_case.PageTestTestCase): ...@@ -95,9 +95,9 @@ class TabSwitchingUnittest(page_test_test_case.PageTestTestCase):
[browser.tabs[-1]] * 2] [browser.tabs[-1]] * 2]
self.assertEqual(expected_calls, mock_get_histogram.mock_calls) self.assertEqual(expected_calls, mock_get_histogram.mock_calls)
@benchmark.Enabled('has tabs') @decorators.Enabled('has tabs')
@benchmark.Disabled('mac') @decorators.Disabled('mac')
@benchmark.Disabled('android') @decorators.Disabled('android')
def testTabSwitching(self): def testTabSwitching(self):
"""IT of TabSwitching measurement and multi-tab story""" """IT of TabSwitching measurement and multi-tab story"""
ps = story_module.StorySet() ps = story_module.StorySet()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment