From 978287fb258c452dcd4997a71b7e5d77d197d006 Mon Sep 17 00:00:00 2001 From: nednguyen Date: Wed, 22 Apr 2015 08:53:17 -0700 Subject: [PATCH] [Telemetry] Remove smoothness's reliance on auto issuing marker feature of smoothness_controller. To make sure that this doesn't cause any problem to existing benchmarks, I modified benchmark_smoke_unittest to make sure it run all smoothness benchmarks on all page sets in temporary patches. (See the telemetry_perf_unittest's log in patch 6) BUG=444701 Review URL: https://codereview.chromium.org/1092723002 Cr-Commit-Position: refs/heads/master@{#326310} --- tools/perf/measurements/smoothness.py | 2 +- tools/perf/measurements/smoothness_unittest.py | 24 ------------------------ tools/perf/measurements/thread_times_unittest.py | 14 ++++++++++++-- tools/perf/page_sets/image_decoding_cases.py | 3 ++- tools/perf/page_sets/tough_animation_cases.py | 3 ++- tools/perf/page_sets/tough_canvas_cases.py | 3 ++- tools/perf/page_sets/tough_filters_cases.py | 10 ++++++---- tools/perf/page_sets/tough_scheduling_cases.py | 3 ++- tools/perf/page_sets/tough_webgl_cases.py | 3 ++- 9 files changed, 29 insertions(+), 36 deletions(-) diff --git a/tools/perf/measurements/smoothness.py b/tools/perf/measurements/smoothness.py index 12cec16d4406..6cf2741f7ecd 100644 --- a/tools/perf/measurements/smoothness.py +++ b/tools/perf/measurements/smoothness.py @@ -8,7 +8,7 @@ from measurements import smoothness_controller class Smoothness(page_test.PageTest): - def __init__(self, enable_auto_issuing_marker=True): + def __init__(self, enable_auto_issuing_marker=False): super(Smoothness, self).__init__() self._smoothness_controller = None self._enable_auto_issuing_marker = enable_auto_issuing_marker diff --git a/tools/perf/measurements/smoothness_unittest.py b/tools/perf/measurements/smoothness_unittest.py index a3f95068730b..1a4f4e9d0cd3 100644 --- a/tools/perf/measurements/smoothness_unittest.py +++ b/tools/perf/measurements/smoothness_unittest.py @@ -29,16 +29,6 @@ class FakeBrowser(object): self.platform = FakePlatform() -class AnimatedPage(page.Page): - def __init__(self, page_set): - super(AnimatedPage, self).__init__( - url='file://animated_page.html', - page_set=page_set, base_dir=page_set.base_dir) - - def RunPageInteractions(self, action_runner): - action_runner.Wait(.2) - - class FakeTab(object): def __init__(self): self.browser = FakeBrowser() @@ -147,19 +137,5 @@ class SmoothnessUnitTest(page_test_test_case.PageTestTestCase): self.assertEquals(1, len(frame_lengths)) self.assertGreater(frame_lengths[0].GetRepresentativeNumber, 0) - @decorators.Disabled('mac', 'chromeos') # http://crbug.com/403903 - def testSmoothnessForPageWithNoGesture(self): - ps = self.CreateEmptyPageSet() - ps.AddUserStory(AnimatedPage(ps)) - - measurement = smoothness.Smoothness() - results = self.RunMeasurement(measurement, ps, options=self._options) - self.assertEquals(0, len(results.failures)) - - percentage_smooth = results.FindAllPageSpecificValuesNamed( - 'percentage_smooth') - self.assertEquals(len(percentage_smooth), 1) - self.assertGreaterEqual(percentage_smooth[0].GetRepresentativeNumber(), 0) - def testCleanUpTrace(self): self.TestTracingCleanedUp(smoothness.Smoothness, self._options) diff --git a/tools/perf/measurements/thread_times_unittest.py b/tools/perf/measurements/thread_times_unittest.py index 310b98cbc12e..a6a2426e265e 100644 --- a/tools/perf/measurements/thread_times_unittest.py +++ b/tools/perf/measurements/thread_times_unittest.py @@ -4,14 +4,24 @@ from telemetry.core import wpr_modes from telemetry import decorators +from telemetry.page import page from telemetry.unittest_util import options_for_unittests from telemetry.unittest_util import page_test_test_case -from measurements import smoothness_unittest from measurements import thread_times from metrics import timeline +class AnimatedPage(page.Page): + def __init__(self, page_set): + super(AnimatedPage, self).__init__( + url='file://animated_page.html', + page_set=page_set, base_dir=page_set.base_dir) + + def RunPageInteractions(self, action_runner): + action_runner.Wait(.2) + + class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase): def setUp(self): self._options = options_for_unittests.GetCopy() @@ -32,7 +42,7 @@ class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase): def testBasicForPageWithNoGesture(self): ps = self.CreateEmptyPageSet() - ps.AddUserStory(smoothness_unittest.AnimatedPage(ps)) + ps.AddUserStory(AnimatedPage(ps)) measurement = thread_times.ThreadTimes() timeline_options = self._options diff --git a/tools/perf/page_sets/image_decoding_cases.py b/tools/perf/page_sets/image_decoding_cases.py index a2131157ed1b..335040f6332f 100644 --- a/tools/perf/page_sets/image_decoding_cases.py +++ b/tools/perf/page_sets/image_decoding_cases.py @@ -10,7 +10,8 @@ class ImageDecodingCasesPage(page_module.Page): super(ImageDecodingCasesPage, self).__init__(url=url, page_set=page_set) def RunPageInteractions(self, action_runner): - action_runner.Wait(5) + with action_runner.CreateInteraction('DecodeImage'): + action_runner.Wait(5) class ImageDecodingCasesPageSet(page_set_module.PageSet): diff --git a/tools/perf/page_sets/tough_animation_cases.py b/tools/perf/page_sets/tough_animation_cases.py index 5c458d8b8261..485926a671f6 100644 --- a/tools/perf/page_sets/tough_animation_cases.py +++ b/tools/perf/page_sets/tough_animation_cases.py @@ -18,7 +18,8 @@ class ToughAnimationCasesPage(page_module.Page): action_runner.WaitForJavaScriptCondition('window.measurementReady') def RunPageInteractions(self, action_runner): - action_runner.Wait(10) + with action_runner.CreateInteraction('ToughAnimation'): + action_runner.Wait(10) class ToughAnimationCasesPageSet(page_set_module.PageSet): diff --git a/tools/perf/page_sets/tough_canvas_cases.py b/tools/perf/page_sets/tough_canvas_cases.py index 292e9118c300..dd8f9f58c1ac 100644 --- a/tools/perf/page_sets/tough_canvas_cases.py +++ b/tools/perf/page_sets/tough_canvas_cases.py @@ -17,7 +17,8 @@ class ToughCanvasCasesPage(page_module.Page): "document.readyState == 'complete'") def RunPageInteractions(self, action_runner): - action_runner.Wait(5) + with action_runner.CreateInteraction('CanvasAnimation'): + action_runner.Wait(5) class MicrosofFirefliesPage(ToughCanvasCasesPage): diff --git a/tools/perf/page_sets/tough_filters_cases.py b/tools/perf/page_sets/tough_filters_cases.py index 6b6fc0427e1d..a51e961e1a17 100644 --- a/tools/perf/page_sets/tough_filters_cases.py +++ b/tools/perf/page_sets/tough_filters_cases.py @@ -8,15 +8,17 @@ from telemetry.page import page_set as page_set_module class ToughFiltersCasesPage(page_module.Page): def RunPageInteractions(self, action_runner): - action_runner.Wait(10) + with action_runner.CreateInteraction('Filter'): + action_runner.Wait(10) class PirateMarkPage(page_module.Page): def RunPageInteractions(self, action_runner): - action_runner.EvaluateJavaScript( - 'document.getElementById("benchmarkButtonText").click()') - action_runner.Wait(10) + with action_runner.CreateInteraction('Filter'): + action_runner.EvaluateJavaScript( + 'document.getElementById("benchmarkButtonText").click()') + action_runner.Wait(10) class ToughFiltersCasesPageSet(page_set_module.PageSet): diff --git a/tools/perf/page_sets/tough_scheduling_cases.py b/tools/perf/page_sets/tough_scheduling_cases.py index 275f470627d7..6ea808e0d003 100644 --- a/tools/perf/page_sets/tough_scheduling_cases.py +++ b/tools/perf/page_sets/tough_scheduling_cases.py @@ -293,7 +293,8 @@ class Page19(ToughSchedulingCasesPage): page_set=page_set) def RunPageInteractions(self, action_runner): - action_runner.Wait(3) + with action_runner.CreateInteraction('SplitAnimation'): + action_runner.Wait(3) class Page20(ToughSchedulingCasesPage): diff --git a/tools/perf/page_sets/tough_webgl_cases.py b/tools/perf/page_sets/tough_webgl_cases.py index 461eb55e1e2d..099fb9a3b7b9 100644 --- a/tools/perf/page_sets/tough_webgl_cases.py +++ b/tools/perf/page_sets/tough_webgl_cases.py @@ -27,7 +27,8 @@ class ToughWebglCasesPage(page_module.Page): action_runner.Wait(2) def RunPageInteractions(self, action_runner): - action_runner.Wait(5) + with action_runner.CreateInteraction('WebGLAnimation'): + action_runner.Wait(5) class ToughWebglCasesPageSet(page_set_module.PageSet): -- 2.11.4.GIT