Commit 26e59874 authored by hashimoto's avatar hashimoto Committed by Commit bot

Enable smoothness.tough_pinch_zoom_cases on Chrome OS

Also, fix a bug in decorators.py where every element in |enabled_strings| except the first one is ignored.

BUG=443981
TEST=tools/perf/run_benchmark --browser=cros-chrome --remote=${host} smoothness.tough_pinch_zoom_cases

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

Cr-Commit-Position: refs/heads/master@{#309339}
parent 29457afd
......@@ -103,7 +103,7 @@ class SmoothnessSimpleMobilePages(benchmark.Benchmark):
test = smoothness.Smoothness
page_set = page_sets.SimpleMobileSitesPageSet
@benchmark.Enabled('android')
@benchmark.Enabled('android', 'chromeos')
class SmoothnessToughPinchZoomCases(benchmark.Benchmark):
"""Measures rendering statistics for pinch-zooming into the tough pinch zoom
cases
......@@ -157,4 +157,3 @@ class SmoothnessGpuImageDecodingCases(benchmark.Benchmark):
silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
# TODO: Remove the following line once M41 goes stable
options.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
......@@ -169,12 +169,11 @@ def ShouldSkip(test, possible_browser):
for enabled_string in enabled_strings:
if enabled_string in platform_attributes:
return False, None
return (True,
'Skipping %s (%s) because it is only enabled for %s. '
'You are running %s.' % (name, str(test),
' or '.join(enabled_strings),
' '.join(platform_attributes)))
return False, None
return (True,
'Skipping %s (%s) because it is only enabled for %s. '
'You are running %s.' % (name, str(test),
' or '.join(enabled_strings),
' '.join(platform_attributes)))
return False, None
......
# 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.
import unittest
from telemetry import decorators
class FakePlatform(object):
def GetOSName(self):
return 'os_name'
def GetOSVersionName(self):
return 'os_version_name'
class FakePossibleBrowser(object):
def __init__(self):
self.browser_type = 'browser_type'
self.platform = FakePlatform()
self.supports_tab_control = False
class FakeTest(object):
def SetEnabledStrings(self, enabled_strings):
# pylint: disable=W0201
self._enabled_strings = enabled_strings
def SetDisabledStrings(self, disabled_strings):
# pylint: disable=W0201
self._disabled_strings = disabled_strings
class TestShouldSkip(unittest.TestCase):
def testEnabledStrings(self):
test = FakeTest()
possible_browser = FakePossibleBrowser()
# When no enabled_strings is given, everything should be enabled.
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
test.SetEnabledStrings(['os_name'])
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
test.SetEnabledStrings(['another_os_name'])
self.assertTrue(decorators.ShouldSkip(test, possible_browser)[0])
test.SetEnabledStrings(['os_version_name'])
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
test.SetEnabledStrings(['os_name', 'another_os_name'])
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
test.SetEnabledStrings(['another_os_name', 'os_name'])
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
test.SetEnabledStrings(['another_os_name', 'another_os_version_name'])
self.assertTrue(decorators.ShouldSkip(test, possible_browser)[0])
def testDisabledStrings(self):
test = FakeTest()
possible_browser = FakePossibleBrowser()
# When no disabled_strings is given, nothing should be disabled.
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
test.SetDisabledStrings(['os_name'])
self.assertTrue(decorators.ShouldSkip(test, possible_browser)[0])
test.SetDisabledStrings(['another_os_name'])
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
test.SetDisabledStrings(['os_version_name'])
self.assertTrue(decorators.ShouldSkip(test, possible_browser)[0])
test.SetDisabledStrings(['os_name', 'another_os_name'])
self.assertTrue(decorators.ShouldSkip(test, possible_browser)[0])
test.SetDisabledStrings(['another_os_name', 'os_name'])
self.assertTrue(decorators.ShouldSkip(test, possible_browser)[0])
test.SetDisabledStrings(['another_os_name', 'another_os_version_name'])
self.assertFalse(decorators.ShouldSkip(test, possible_browser)[0])
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