0

Replaced @benchmark.Enabled/Disabled and @test.Enabled/Disabled with @decorators.Enabled/Disabled in all unit tests

BUG=

Review URL: https://codereview.chromium.org/797003002

Cr-Commit-Position: refs/heads/master@{#308607}
This commit is contained in:
sullivan
2014-12-16 09:39:27 -08:00
committed by Commit bot
parent dd408bbfb4
commit a172a0945e
31 changed files with 117 additions and 126 deletions

@ -6,7 +6,6 @@ from measurements import oilpan_gc_times
from telemetry.core import wpr_modes
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.unittest_util import test
class OilpanGCTimesTest(page_test_test_case.PageTestTestCase):
"""Smoke test for Oilpan GC pause time measurements.

@ -5,11 +5,11 @@
import logging
from measurements import rasterize_and_record_micro
from telemetry import decorators
from telemetry.core import wpr_modes
from telemetry.page import page_test
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.unittest_util import test
class RasterizeAndRecordMicroUnitTest(page_test_test_case.PageTestTestCase):
@ -24,7 +24,7 @@ class RasterizeAndRecordMicroUnitTest(page_test_test_case.PageTestTestCase):
self._options = options_for_unittests.GetCopy()
self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
@test.Disabled('win', 'chromeos')
@decorators.Disabled('win', 'chromeos')
def testRasterizeAndRecordMicro(self):
ps = self.CreatePageSetFromFileInUnittestDataDir('blank.html')
measurement = rasterize_and_record_micro.RasterizeAndRecordMicro(

@ -4,9 +4,9 @@
from measurements import record_per_area
from telemetry.core import wpr_modes
from telemetry import decorators
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.unittest_util import test
class RecordPerAreaUnitTest(page_test_test_case.PageTestTestCase):
@ -21,7 +21,7 @@ class RecordPerAreaUnitTest(page_test_test_case.PageTestTestCase):
self._options = options_for_unittests.GetCopy()
self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
@test.Disabled('android')
@decorators.Disabled('android')
def testRecordPerArea(self):
ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html')
measurement = record_per_area.RecordPerArea()

@ -3,11 +3,11 @@
# found in the LICENSE file.
from measurements import repaint
from telemetry import decorators
from telemetry.core import wpr_modes
from telemetry.page import page as page_module
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.unittest_util import test
class TestRepaintPage(page_module.Page):
@ -56,6 +56,6 @@ class RepaintUnitTest(page_test_test_case.PageTestTestCase):
self.assertEquals(len(percentage_smooth), 1)
self.assertGreaterEqual(percentage_smooth[0].GetRepresentativeNumber(), 0)
@test.Disabled('android')
@decorators.Disabled('android')
def testCleanUpTrace(self):
self.TestTracingCleanedUp(repaint.Repaint, self._options)

@ -6,9 +6,9 @@ import shutil
import tempfile
from measurements import skpicture_printer
from telemetry import decorators
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.unittest_util import test
class SkpicturePrinterUnitTest(page_test_test_case.PageTestTestCase):
@ -19,7 +19,7 @@ class SkpicturePrinterUnitTest(page_test_test_case.PageTestTestCase):
def tearDown(self):
shutil.rmtree(self._skp_outdir)
@test.Disabled('android')
@decorators.Disabled('android')
def testSkpicturePrinter(self):
ps = self.CreatePageSetFromFileInUnittestDataDir('blank.html')
measurement = skpicture_printer.SkpicturePrinter(self._skp_outdir)

@ -5,12 +5,12 @@ import sys
from measurements import smoothness
from metrics import power
from telemetry import decorators
from telemetry.core import exceptions
from telemetry.core import wpr_modes
from telemetry.page import page
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.unittest_util import test
class FakeTracingController(object):
def __init__(self):
@ -128,7 +128,7 @@ class SmoothnessUnitTest(page_test_test_case.PageTestTestCase):
self.assertGreater(
mean_input_event_latency[0].GetRepresentativeNumber(), 0)
@test.Disabled('mac', 'chromeos') # http://crbug.com/403903
@decorators.Disabled('mac', 'chromeos') # http://crbug.com/403903
def testSmoothnessForPageWithNoGesture(self):
ps = self.CreateEmptyPageSet()
ps.AddUserStory(AnimatedPage(ps))

@ -5,10 +5,10 @@
from measurements import thread_times
from measurements import smoothness_unittest
from metrics import timeline
from telemetry import decorators
from telemetry.core import wpr_modes
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.unittest_util import test
@ -17,7 +17,7 @@ class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase):
self._options = options_for_unittests.GetCopy()
self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
@test.Disabled('android')
@decorators.Disabled('android')
def testBasic(self):
ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html')
measurement = thread_times.ThreadTimes()

@ -4,14 +4,14 @@
import logging
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core.backends.chrome import cros_test_case
class CrOSCryptohomeTest(cros_test_case.CrOSTestCase):
@benchmark.Enabled('chromeos')
@decorators.Enabled('chromeos')
def testCryptohome(self):
"""Verifies cryptohome mount status for regular and guest user and when
logged out"""
@ -36,7 +36,7 @@ class CrOSCryptohomeTest(cros_test_case.CrOSTestCase):
class CrOSLoginTest(cros_test_case.CrOSTestCase):
@benchmark.Enabled('chromeos')
@decorators.Enabled('chromeos')
def testLoginStatus(self):
"""Tests autotestPrivate.loginStatus"""
if self._is_guest:
@ -50,7 +50,7 @@ class CrOSLoginTest(cros_test_case.CrOSTestCase):
self.assertEquals(login_status['email'], self._username)
self.assertFalse(login_status['isScreenLocked'])
@benchmark.Enabled('chromeos')
@decorators.Enabled('chromeos')
def testLogout(self):
"""Tests autotestPrivate.logout"""
if self._is_guest:
@ -64,7 +64,7 @@ class CrOSLoginTest(cros_test_case.CrOSTestCase):
pass
util.WaitFor(lambda: not self._IsCryptohomeMounted(), 20)
@benchmark.Enabled('chromeos')
@decorators.Enabled('chromeos')
def testGaiaLogin(self):
"""Tests gaia login. Credentials are expected to be found in a
credentials.txt file, with a single line of format username:password."""
@ -121,7 +121,7 @@ class CrOSScreenLockerTest(cros_test_case.CrOSTestCase):
util.WaitFor(lambda: not browser.oobe_exists, 10)
self.assertFalse(self._IsScreenLocked(browser))
@benchmark.Disabled
@decorators.Disabled
def testScreenLock(self):
"""Tests autotestPrivate.screenLock"""
if self._is_guest:

@ -3,16 +3,16 @@
# found in the LICENSE file.
import unittest
from telemetry import decorators
from telemetry.core import browser_options
from telemetry.core.backends.chrome import ios_browser_finder
from telemetry.unittest_util import test
class IosBrowserFinderUnitTest(unittest.TestCase):
# TODO(baxley): Currently the tests require a device with Chrome running.
# This should be stubbed out so it runs on any system, with no device
# dependencies.
@test.Enabled('ios')
@decorators.Enabled('ios')
def testFindIosChrome(self):
finder_options = browser_options.BrowserFinderOptions()
browsers = ios_browser_finder.FindAllAvailableBrowsers(finder_options)

@ -6,7 +6,7 @@ import cStringIO
import json
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import util
from telemetry.core.platform import tracing_category_filter
from telemetry.core.platform import tracing_options
@ -27,7 +27,7 @@ class TracingBackendTest(tab_test_case.TabTestCase):
self.skipTest('Browser does not support tracing, skipping test.')
self._StartServer()
@benchmark.Disabled('chromeos') # crbug.com/412713.
@decorators.Disabled('chromeos') # crbug.com/412713.
def testGotTrace(self):
options = tracing_options.TracingOptions()
options.enable_chrome_trace = True
@ -37,7 +37,7 @@ class TracingBackendTest(tab_test_case.TabTestCase):
# Test that trace data is parsable
model.TimelineModel(trace_data)
@benchmark.Disabled('chromeos') # crbug.com/412713.
@decorators.Disabled('chromeos') # crbug.com/412713.
def testStartAndStopTraceMultipleTimes(self):
options = tracing_options.TracingOptions()
options.enable_chrome_trace = True

@ -2,14 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import benchmark
from telemetry import decorators
from telemetry.unittest_util import tab_test_case
class InspectorMemoryTest(tab_test_case.TabTestCase):
@benchmark.Enabled('has tabs')
@benchmark.Disabled # http://crbug.com/422244
@decorators.Enabled('has tabs')
@decorators.Disabled # http://crbug.com/422244
def testGetDOMStats(self):
# Due to an issue with CrOS, we create a new tab here rather than
# using the existing tab to get a consistent starting page on all platforms.

@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import benchmark
from telemetry import decorators
from telemetry.core.backends.chrome_inspector import inspector_network
from telemetry.timeline import recording_options
from telemetry.unittest_util import tab_test_case
@ -71,7 +71,7 @@ class InspectorNetworkTabTest(tab_test_case.TabTestCase):
# Flaky on many platforms (at least Win, Linux, and Mac).
# http://crbug.com/424706
@benchmark.Disabled
@decorators.Disabled
def testCacheableHTTPResponse(self):
# We know this page has one PNG image and its cacheable.
events = self._NavigateAndGetHTTPResponseEvents('image_decoding.html')

@ -6,7 +6,7 @@ import os
import tempfile
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import bitmap
from telemetry.core import util
@ -96,7 +96,7 @@ class BitmapTest(unittest.TestCase):
new_file = bitmap.Bitmap.FromPngFile(temp_file)
self.assertTrue(orig.IsEqual(new_file))
@benchmark.Disabled
@decorators.Disabled
def testWriteCroppedBmpToPngFile(self):
pixels = [255,0,0, 255,255,0, 0,0,0,
255,255,0, 0,255,0, 0,0,0]
@ -142,7 +142,7 @@ class BitmapTest(unittest.TestCase):
diff_bmp.GetPixelColor(2, 1).AssertIsRGB(255, 255, 255)
diff_bmp.GetPixelColor(2, 2).AssertIsRGB(255, 255, 255)
@benchmark.Disabled
@decorators.Disabled
def testGetBoundingBox(self):
pixels = [0,0,0, 0,0,0, 0,0,0, 0,0,0,
0,0,0, 1,0,0, 1,0,0, 0,0,0,
@ -156,7 +156,7 @@ class BitmapTest(unittest.TestCase):
self.assertEquals(box, None)
self.assertEquals(count, 0)
@benchmark.Disabled
@decorators.Disabled
def testCrop(self):
pixels = [0,0,0, 1,0,0, 2,0,0, 3,0,0,
0,1,0, 1,1,0, 2,1,0, 3,1,0,
@ -170,7 +170,7 @@ class BitmapTest(unittest.TestCase):
bmp.GetPixelColor(1, 0).AssertIsRGB(2, 2, 0)
self.assertEquals(bmp.pixels, bytearray([1,2,0, 2,2,0]))
@benchmark.Disabled
@decorators.Disabled
def testHistogram(self):
pixels = [1,2,3, 1,2,3, 1,2,3, 1,2,3,
1,2,3, 8,7,6, 5,4,6, 1,2,3,
@ -190,7 +190,7 @@ class BitmapTest(unittest.TestCase):
self.assertEquals(histogram.b[3], 0)
self.assertEquals(histogram.b[6], 4)
@benchmark.Disabled
@decorators.Disabled
def testHistogramIgnoreColor(self):
pixels = [1,2,3, 1,2,3, 1,2,3, 1,2,3,
1,2,3, 8,7,6, 5,4,6, 1,2,3,
@ -207,7 +207,7 @@ class BitmapTest(unittest.TestCase):
self.assertEquals(histogram.b[3], 0)
self.assertEquals(histogram.b[6], 4)
@benchmark.Disabled
@decorators.Disabled
def testHistogramIgnoreColorTolerance(self):
pixels = [1,2,3, 4,5,6,
7,8,9, 8,7,6]
@ -227,7 +227,7 @@ class BitmapTest(unittest.TestCase):
self.assertEquals(histogram.b[6], 2)
self.assertEquals(histogram.b[9], 1)
@benchmark.Disabled
@decorators.Disabled
def testHistogramDistanceIgnoreColor(self):
pixels = [1,2,3, 1,2,3,
1,2,3, 1,2,3]

@ -8,7 +8,7 @@ import shutil
import tempfile
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import browser_finder
from telemetry.core import gpu_device
from telemetry.core import gpu_info
@ -33,7 +33,7 @@ class BrowserTest(browser_test_case.BrowserTestCase):
v = self._browser._browser_backend.chrome_branch_number
self.assertTrue(v > 0)
@benchmark.Enabled('has tabs')
@decorators.Enabled('has tabs')
def testNewCloseTab(self):
existing_tab = self._browser.tabs[0]
self.assertEquals(1, len(self._browser.tabs))
@ -57,8 +57,8 @@ class BrowserTest(browser_test_case.BrowserTestCase):
tab.Navigate(self.UrlOfUnittestFile('blank.html'))
self._browser.tabs[0].WaitForDocumentReadyStateToBeInteractiveOrBetter()
@benchmark.Enabled('has tabs')
@benchmark.Disabled('win') # crbug.com/321527
@decorators.Enabled('has tabs')
@decorators.Disabled('win') # crbug.com/321527
def testCloseReferencedTab(self):
self._browser.tabs.New()
tab = self._browser.tabs[0]
@ -66,7 +66,7 @@ class BrowserTest(browser_test_case.BrowserTestCase):
tab.Close()
self.assertEquals(1, len(self._browser.tabs))
@benchmark.Enabled('has tabs')
@decorators.Enabled('has tabs')
def testForegroundTab(self):
# Should be only one tab at this stage, so that must be the foreground tab
original_tab = self._browser.tabs[0]
@ -112,7 +112,7 @@ class BrowserTest(browser_test_case.BrowserTestCase):
def testGetSystemTotalMemory(self):
self.assertTrue(self._browser.memory_stats['SystemTotalPhysicalMemory'] > 0)
@benchmark.Disabled('chromeos') # crbug.com/412713.
@decorators.Disabled('chromeos') # crbug.com/412713.
def testIsTracingRunning(self):
tracing_controller = self._browser.platform.tracing_controller
if not tracing_controller.IsChromeTracingSupported(self._browser):
@ -146,7 +146,7 @@ class DirtyProfileBrowserTest(browser_test_case.BrowserTestCase):
def CustomizeBrowserOptions(cls, options):
options.profile_type = 'small_profile'
@benchmark.Disabled('chromeos') # crbug.com/243912
@decorators.Disabled('chromeos') # crbug.com/243912
def testDirtyProfileCreation(self):
self.assertEquals(1, len(self._browser.tabs))
@ -186,8 +186,8 @@ class BrowserRestoreSessionTest(unittest.TestCase):
cls._options.browser_options.profile_dir = cls._profile_dir
cls._browser_to_create = browser_finder.FindBrowser(cls._options)
@benchmark.Enabled('has tabs')
@benchmark.Disabled('chromeos', 'win', 'mac')
@decorators.Enabled('has tabs')
@decorators.Disabled('chromeos', 'win', 'mac')
# TODO(nednguyen): Enable this test on windowsn platform
def testRestoreBrowserWithMultipleTabs(self):
with self._browser_to_create.Create(self._options) as browser:

@ -4,7 +4,7 @@
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core.platform import android_device
from telemetry.core.platform import android_platform_backend
from telemetry.unittest_util import system_stub
@ -25,7 +25,7 @@ class AndroidPlatformBackendTest(unittest.TestCase):
self._stubs.Restore()
android_platform_backend.psutil = self._actual_ps_util
@benchmark.Disabled('chromeos')
@decorators.Disabled('chromeos')
def testGetCpuStats(self):
proc_stat_content = [
'7702 (.android.chrome) S 167 167 0 0 -1 1077936448 '
@ -41,7 +41,7 @@ class AndroidPlatformBackendTest(unittest.TestCase):
cpu_stats = backend.GetCpuStats('7702')
self.assertEquals(cpu_stats, {'CpuProcessTime': 0.05})
@benchmark.Disabled('chromeos')
@decorators.Disabled('chromeos')
def testGetCpuStatsInvalidPID(self):
# Mock an empty /proc/pid/stat.
backend = android_platform_backend.AndroidPlatformBackend(

@ -10,7 +10,7 @@ import socket
import tempfile
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import forwarders
from telemetry.core.platform import cros_interface
from telemetry.core.forwarders import cros_forwarder
@ -24,7 +24,7 @@ class CrOSInterfaceTest(unittest.TestCase):
remote,
options_for_unittests.GetCopy().cros_ssh_identity)
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testPushContents(self):
with self._GetCRI() as cri:
cri.RunCmdOnDevice(['rm', '-rf', '/tmp/testPushContents'])
@ -32,27 +32,27 @@ class CrOSInterfaceTest(unittest.TestCase):
contents = cri.GetFileContents('/tmp/testPushContents')
self.assertEquals(contents, 'hello world')
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testExists(self):
with self._GetCRI() as cri:
self.assertTrue(cri.FileExistsOnDevice('/proc/cpuinfo'))
self.assertTrue(cri.FileExistsOnDevice('/etc/passwd'))
self.assertFalse(cri.FileExistsOnDevice('/etc/sdlfsdjflskfjsflj'))
@benchmark.Enabled('linux')
@decorators.Enabled('linux')
def testExistsLocal(self):
with cros_interface.CrOSInterface() as cri:
self.assertTrue(cri.FileExistsOnDevice('/proc/cpuinfo'))
self.assertTrue(cri.FileExistsOnDevice('/etc/passwd'))
self.assertFalse(cri.FileExistsOnDevice('/etc/sdlfsdjflskfjsflj'))
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testGetFileContents(self): # pylint: disable=R0201
with self._GetCRI() as cri:
hosts = cri.GetFileContents('/etc/lsb-release')
self.assertTrue('CHROMEOS' in hosts)
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testGetFileContentsNonExistent(self):
with self._GetCRI() as cri:
f = tempfile.NamedTemporaryFile()
@ -62,7 +62,7 @@ class CrOSInterfaceTest(unittest.TestCase):
OSError,
lambda: cri.GetFileContents(f.name))
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testGetFile(self): # pylint: disable=R0201
with self._GetCRI() as cri:
f = tempfile.NamedTemporaryFile()
@ -71,7 +71,7 @@ class CrOSInterfaceTest(unittest.TestCase):
res = f2.read()
self.assertTrue('CHROMEOS' in res)
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testGetFileNonExistent(self):
with self._GetCRI() as cri:
f = tempfile.NamedTemporaryFile()
@ -81,17 +81,17 @@ class CrOSInterfaceTest(unittest.TestCase):
OSError,
lambda: cri.GetFile(f.name))
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testIsServiceRunning(self):
with self._GetCRI() as cri:
self.assertTrue(cri.IsServiceRunning('openssh-server'))
@benchmark.Enabled('linux')
@decorators.Enabled('linux')
def testIsServiceRunningLocal(self):
with cros_interface.CrOSInterface() as cri:
self.assertTrue(cri.IsServiceRunning('dbus'))
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testGetRemotePortAndIsHTTPServerRunningOnPort(self):
with self._GetCRI() as cri:
# Create local server.
@ -125,7 +125,7 @@ class CrOSInterfaceTest(unittest.TestCase):
# longer in use.
self.assertFalse(cri.IsHTTPServerRunningOnPort(remote_port))
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testGetRemotePortReservedPorts(self):
with self._GetCRI() as cri:
# Should return 2 separate ports even though the first one isn't
@ -135,7 +135,7 @@ class CrOSInterfaceTest(unittest.TestCase):
self.assertTrue(remote_port_1 != remote_port_2)
@benchmark.Enabled('cros-chrome')
@decorators.Enabled('cros-chrome')
def testTakeScreenShot(self):
with self._GetCRI() as cri:
def _Cleanup():
@ -148,7 +148,7 @@ class CrOSInterfaceTest(unittest.TestCase):
# TODO(tengs): It would be best if we can filter this test and other tests
# that need to be run locally based on the platform of the system browser.
@benchmark.Enabled('linux')
@decorators.Enabled('linux')
def testEscapeCmdArguments(self):
''' Commands and their arguments that are executed through the cros
interface should follow bash syntax. This test needs to run on remotely

@ -5,7 +5,7 @@
import os
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import platform as platform_module
from telemetry.core.platform import platform_backend
@ -25,7 +25,7 @@ class MacPlatformBackendTest(unittest.TestCase):
'mavericks2')
self.assertEqual(platform_backend.LION.upper(), 'LION')
@benchmark.Enabled('mac')
@decorators.Enabled('mac')
def testGetCPUStats(self):
platform = platform_module.GetHostPlatform()

@ -6,12 +6,12 @@ import logging
import time
import unittest
from telemetry import decorators
from telemetry.core import platform as platform_module
from telemetry.unittest_util import test
class PlatformBackendTest(unittest.TestCase):
@test.Disabled('mac') # http://crbug.com/440666
@decorators.Disabled('mac') # http://crbug.com/440666
def testPowerMonitoringSync(self):
# Tests that the act of monitoring power doesn't blow up.
platform = platform_module.GetHostPlatform()

@ -5,9 +5,9 @@ import os
import sys
import unittest
from telemetry import decorators
from telemetry.core import platform as platform_module
from telemetry.core.platform import posix_platform_backend
from telemetry.unittest_util import test
class TestBackend(posix_platform_backend.PosixPlatformBackend):
@ -76,7 +76,7 @@ class PosixPlatformBackendTest(unittest.TestCase):
posix_platform_backend._BinaryExistsInSudoersFiles(
binary_path,' (root) NOPASSWD: /usr/bin/pkill arg1 arg2'))
@test.Enabled('linux', 'mac')
@decorators.Enabled('linux', 'mac')
def testIsApplicationRunning(self):
platform = platform_module.GetHostPlatform()

@ -6,11 +6,11 @@ import logging
import os
import unittest
from telemetry import decorators
from telemetry.core import util
from telemetry.core.platform import mac_platform_backend
from telemetry.core.platform import platform_backend
from telemetry.core.platform.power_monitor import powermetrics_power_monitor
from telemetry.unittest_util import test
def _parsePowerMetricsDataFromTestFile(output_file):
@ -22,7 +22,7 @@ def _parsePowerMetricsDataFromTestFile(output_file):
class PowerMetricsPowerMonitorTest(unittest.TestCase):
@test.Enabled('mac')
@decorators.Enabled('mac')
def testCanMonitorPowerUsage(self):
backend = mac_platform_backend.MacPlatformBackend()
power_monitor = powermetrics_power_monitor.PowerMetricsPowerMonitor(backend)
@ -32,19 +32,19 @@ class PowerMetricsPowerMonitorTest(unittest.TestCase):
self.assertEqual(power_monitor.CanMonitorPower(), mavericks_or_later,
"Error checking powermetrics availability: '%s'" % '|'.join(os.uname()))
@test.Enabled('mac')
@decorators.Enabled('mac')
def testParseEmptyPowerMetricsOutput(self):
# Important to handle zero length powermetrics outout - crbug.com/353250 .
self.assertIsNone(powermetrics_power_monitor.PowerMetricsPowerMonitor.
ParsePowerMetricsOutput(''))
@test.Enabled('mac')
@decorators.Enabled('mac')
def testParsePowerMetricsOutputFromVM(self):
# Don't fail when running on VM - crbug.com/423688.
self.assertEquals({},
_parsePowerMetricsDataFromTestFile('powermetrics_vmware.output'))
@test.Enabled('mac')
@decorators.Enabled('mac')
def testParsePowerMetricsOutput(self):
power_monitor = powermetrics_power_monitor.PowerMetricsPowerMonitor(
mac_platform_backend.MacPlatformBackend())

@ -9,7 +9,7 @@ import shutil
import tempfile
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import util
from telemetry.core.platform.profiler import android_profiling_helper
from telemetry.unittest_util import simple_mock
@ -56,7 +56,7 @@ class TestAndroidProfilingHelper(unittest.TestCase):
finally:
android_profiling_helper.subprocess = real_subprocess
@benchmark.Enabled('android')
@decorators.Enabled('android')
def testGetRequiredLibrariesForVTuneProfile(self):
vtune_db_output = os.path.join(
util.GetUnittestDataDir(), 'sample_vtune_db_output')
@ -97,8 +97,8 @@ class TestAndroidProfilingHelperTabTestCase(tab_test_case.TabTestCase):
self._device = browser_backend._adb.device()
# Test fails: crbug.com/437081
# @benchmark.Enabled('android')
@benchmark.Disabled
# @decorators.Enabled('android')
@decorators.Disabled
def testCreateSymFs(self):
# pylint: disable=W0212
browser_pid = self._browser._browser_backend.pid
@ -130,8 +130,8 @@ class TestAndroidProfilingHelperTabTestCase(tab_test_case.TabTestCase):
shutil.rmtree(symfs_dir)
# Test fails: crbug.com/437081
# @benchmark.Enabled('android')
@benchmark.Disabled
# @decorators.Enabled('android')
@decorators.Disabled
def testGetToolchainBinaryPath(self):
with tempfile.NamedTemporaryFile() as libc:
self._device.PullFile('/system/lib/libc.so', libc.name)

@ -6,13 +6,13 @@ import shutil
import tempfile
import zipfile
from telemetry import benchmark
from telemetry import decorators
from telemetry.core.platform.profiler import android_systrace_profiler
from telemetry.unittest_util import tab_test_case
class TestAndroidSystraceProfiler(tab_test_case.TabTestCase):
@benchmark.Enabled('android')
@decorators.Enabled('android')
def testSystraceProfiler(self):
try:
out_dir = tempfile.mkdtemp()

@ -5,7 +5,7 @@
import sys
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core.platform.profiler import vtune_profiler
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import simple_mock
@ -99,7 +99,7 @@ class TestVTuneProfilerTabTestCase(tab_test_case.TabTestCase):
# This test is only meant to be run if VTune is installed locally. Please
# run it locally if you are modifying related code, but it's disabled on the
# bots because they don't have VTune. See crbug.com/437085
@benchmark.Disabled
@decorators.Disabled
def testVTuneProfiler(self):
mock_subprocess = MockSubprocess()
real_subprocess = vtune_profiler.subprocess

@ -5,7 +5,7 @@
import logging
import tempfile
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import bitmap
from telemetry.core import exceptions
from telemetry.core import util
@ -65,7 +65,7 @@ class TabTest(tab_test_case.TabTestCase):
lambda: self._tab.Navigate('chrome://crash',
timeout=5))
@benchmark.Enabled('has tabs')
@decorators.Enabled('has tabs')
def testActivateTab(self):
util.WaitFor(lambda: _IsDocumentVisible(self._tab), timeout=5)
new_tab = self._browser.tabs.New()
@ -104,7 +104,7 @@ class TabTest(tab_test_case.TabTestCase):
# Test failing on android: http://crbug.com/437057
# Also, for chromeos: http://crbug.com/412713
@benchmark.Disabled('android', 'chromeos')
@decorators.Disabled('android', 'chromeos')
def testHighlight(self):
self.assertEquals(self._tab.url, 'about:blank')
options = tracing_options.TracingOptions()
@ -124,8 +124,8 @@ class TabTest(tab_test_case.TabTestCase):
break
self.assertTrue(found_video_start_event)
@benchmark.Enabled('has tabs')
@benchmark.Disabled('chromeos') # crbug.com/412713.
@decorators.Enabled('has tabs')
@decorators.Disabled('chromeos') # crbug.com/412713.
def testGetRendererThreadFromTabId(self):
self.assertEquals(self._tab.url, 'about:blank')
# Create 3 tabs. The third tab is closed before we call
@ -177,7 +177,7 @@ class GpuTabTest(tab_test_case.TabTestCase):
options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
# Test flaky on mac: http://crbug.com/358664
@benchmark.Disabled('android', 'mac')
@decorators.Disabled('android', 'mac')
def testScreenshot(self):
if not self._tab.screenshot_supported:
logging.warning('Browser does not support screenshots, skipping test.')

@ -6,7 +6,7 @@ import logging
import os
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import bitmap
from telemetry.core import platform
from telemetry.core import util
@ -15,7 +15,7 @@ from telemetry.core import video
class VideoTest(unittest.TestCase):
@benchmark.Disabled
@decorators.Disabled
def testFramesFromMp4(self):
host_platform = platform.GetHostPlatform()

@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core.platform import tracing_category_filter
@ -49,7 +49,7 @@ class ActionRunnerInteractionTest(tab_test_case.TabTestCase):
self.assertTrue(getattr(records[0], attribute_name))
# Test disabled for android: crbug.com/437057
@benchmark.Disabled('android', 'chromeos')
@decorators.Disabled('android', 'chromeos')
def testIssuingMultipleMeasurementInteractionRecords(self):
self.VerifyIssuingInteractionRecords(is_fast=True)
self.VerifyIssuingInteractionRecords(is_responsive=True)
@ -183,7 +183,7 @@ class ActionRunnerTest(tab_test_case.TabTestCase):
action_runner.ClickElement('#notfound')
self.assertRaises(exceptions.EvaluateException, WillFail)
@benchmark.Disabled('android', 'debug') # crbug.com/437068
@decorators.Disabled('android', 'debug') # crbug.com/437068
def testTapElement(self):
self.Navigate('page_with_clickables.html')
action_runner = action_runner_module.ActionRunner(self._tab,
@ -206,7 +206,7 @@ class ActionRunnerTest(tab_test_case.TabTestCase):
action_runner.TapElement('#notfound')
self.assertRaises(exceptions.EvaluateException, WillFail)
@benchmark.Disabled('android') # crbug.com/437065.
@decorators.Disabled('android') # crbug.com/437065.
def testScroll(self):
if not page_action.IsGestureSourceTypeSupported(
self._tab, 'touch'):
@ -230,7 +230,7 @@ class ActionRunnerTest(tab_test_case.TabTestCase):
self.assertTrue(action_runner.EvaluateJavaScript(
'document.body.scrollLeft') > 75)
@benchmark.Disabled('android') # crbug.com/437065.
@decorators.Disabled('android') # crbug.com/437065.
def testSwipe(self):
if not page_action.IsGestureSourceTypeSupported(
self._tab, 'touch'):

@ -4,13 +4,13 @@
import os
from telemetry import decorators
from telemetry.page.actions import scroll
from telemetry.unittest_util import tab_test_case
from telemetry.unittest_util import test
class ScrollActionTest(tab_test_case.TabTestCase):
@test.Disabled # Disabled due to flakiness: crbug.com/330544
@decorators.Disabled # Disabled due to flakiness: crbug.com/330544
def testScrollAction(self):
self.Navigate('blank.html')

@ -5,7 +5,7 @@
import json
import os
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import exceptions
from telemetry.core import wpr_modes
from telemetry.page import page as page_module
@ -89,7 +89,7 @@ class PageTestUnitTest(page_test_test_case.PageTestTestCase):
# This test is disabled because it runs against live sites, and needs to be
# fixed. crbug.com/179038
@benchmark.Disabled
@decorators.Disabled
def testRecordAndReplay(self):
test_archive = '/tmp/google.wpr'
google_url = 'http://www.google.com/'

@ -4,7 +4,7 @@
import unittest
from telemetry.unittest_util import test
from telemetry import decorators
# These are not real unittests.
@ -14,50 +14,50 @@ class DisabledCases(unittest.TestCase):
def testAllEnabled(self):
pass
@test.Disabled
@decorators.Disabled
def testAllDisabled(self):
pass
@test.Enabled('mavericks')
@decorators.Enabled('mavericks')
def testMavericksOnly(self):
pass
@test.Disabled('mavericks')
@decorators.Disabled('mavericks')
def testNoMavericks(self):
pass
@test.Enabled('mac')
@decorators.Enabled('mac')
def testMacOnly(self):
pass
@test.Disabled('mac')
@decorators.Disabled('mac')
def testNoMac(self):
pass
@test.Enabled('chromeos')
@decorators.Enabled('chromeos')
def testChromeOSOnly(self):
pass
@test.Disabled('chromeos')
@decorators.Disabled('chromeos')
def testNoChromeOS(self):
pass
@test.Enabled('win', 'linux')
@decorators.Enabled('win', 'linux')
def testWinOrLinuxOnly(self):
pass
@test.Disabled('win', 'linux')
@decorators.Disabled('win', 'linux')
def testNoWinLinux(self):
pass
@test.Enabled('system')
@decorators.Enabled('system')
def testSystemOnly(self):
pass
@test.Disabled('system')
@decorators.Disabled('system')
def testNoSystem(self):
pass
@test.Enabled('has tabs')
@decorators.Enabled('has tabs')
def testHasTabs(self):
pass

@ -1,8 +0,0 @@
# Copyright 2014 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.
from telemetry import decorators
Disabled = decorators.Disabled
Enabled = decorators.Enabled

@ -5,7 +5,7 @@
import os
import unittest
from telemetry import benchmark
from telemetry import decorators
from telemetry.core import platform
from telemetry.core import wpr_modes
from telemetry.page import page as page_module
@ -209,7 +209,7 @@ class TimelineBasedMeasurementTest(page_test_test_case.PageTestTestCase):
# This test is flaky when run in parallel on the mac: crbug.com/426676
# Also, fails on android: crbug.com/437057
@benchmark.Disabled('android', 'mac')
@decorators.Disabled('android', 'mac')
def testSmoothnessTimelineBasedMeasurementForSmoke(self):
ps = self.CreateEmptyPageSet()
ps.AddUserStory(TestTimelinebasedMeasurementPage(
@ -229,7 +229,7 @@ class TimelineBasedMeasurementTest(page_test_test_case.PageTestTestCase):
# This test is flaky when run in parallel on the mac: crbug.com/426676
# Also, fails on android: crbug.com/437057
@benchmark.Disabled('android', 'mac')
@decorators.Disabled('android', 'mac')
def testFastTimelineBasedMeasurementForSmoke(self):
ps = self.CreateEmptyPageSet()
ps.AddUserStory(TestTimelinebasedMeasurementPage(
@ -267,7 +267,7 @@ class TimelineBasedMeasurementTest(page_test_test_case.PageTestTestCase):
# Disabled since mainthread_jank metric is not supported on windows platform.
# Also, flaky on the mac when run in parallel: crbug.com/426676
# Also, fails on android: crbug.com/437057
@benchmark.Disabled('android', 'win', 'mac')
@decorators.Disabled('android', 'win', 'mac')
def testMainthreadJankTimelineBasedMeasurement(self):
ps = self.CreateEmptyPageSet()
ps.AddUserStory(TestTimelinebasedMeasurementPage(