Commit d8cf830e authored by sullivan's avatar sullivan Committed by Commit bot

Revert of [Telemetry] Disable auto issuing record for thread_times (patchset...

Revert of [Telemetry] Disable auto issuing record for thread_times (patchset #3 id:60001 of https://codereview.chromium.org/1140353003/)

Reason for revert:
Seems to have broken service_worker tests (http://crbug.com/490130)

Original issue's description:
> [Telemetry] Disable auto issuing record for thread_times
>
> BUG=444705
> CQ_EXTRA_TRYBOTS=tryserver.chromium.perf:linux_perf_bisect;tryserver.chromium.perf:mac_perf_bisect;tryserver.chromium.perf:android_nexus5_perf_bisect
>
> Committed: https://crrev.com/2905d303db21f120aab1914f98fe0e44284f82ed
> Cr-Commit-Position: refs/heads/master@{#330613}

TBR=eakuefner@chromium.org,nednguyen@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=444705

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

Cr-Commit-Position: refs/heads/master@{#330728}
parent c1192325
......@@ -6,7 +6,6 @@ from itertools import starmap
from collections import defaultdict
from telemetry.core import util
from telemetry.core import exceptions
from telemetry.page import action_runner
from telemetry.page import page_test
from telemetry.value import scalar
......@@ -29,9 +28,7 @@ class BlinkStyle(page_test.PageTest):
self._controller.CleanUp(tab)
def ValidateAndMeasurePage(self, page, tab, results):
runner = action_runner.ActionRunner(tab)
with runner.CreateInteraction('wait-for-quiescence'):
tab.ExecuteJavaScript('console.time("");')
tab.ExecuteJavaScript('console.time("wait-for-quiescence");')
try:
util.WaitFor(tab.HasReachedQuiescence, 15)
except exceptions.TimeoutException:
......@@ -39,6 +36,7 @@ class BlinkStyle(page_test.PageTest):
# categories results, it shouldn't be necessary to reach the same
# state on every run.
pass
tab.ExecuteJavaScript('console.timeEnd("wait-for-quiescence");')
tab.ExecuteJavaScript(
'console.time("style-update");'
......
......@@ -17,8 +17,7 @@ class ThreadTimes(page_test.PageTest):
self._report_silk_details = report_silk_details
def WillNavigateToPage(self, page, tab):
self._timeline_controller = timeline_controller.TimelineController(
enable_auto_issuing_record=False)
self._timeline_controller = timeline_controller.TimelineController()
if self._report_silk_details:
# We need the other traces in order to have any details to report.
self._timeline_controller.trace_categories = None
......
......@@ -41,6 +41,21 @@ class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase):
cpu_time = results.FindAllPageSpecificValuesNamed(cpu_time_name)
self.assertEquals(len(cpu_time), 1)
def testBasicForPageWithNoGesture(self):
ps = self.CreateEmptyPageSet()
ps.AddUserStory(AnimatedPage(ps))
measurement = thread_times.ThreadTimes()
timeline_options = self._options
results = self.RunMeasurement(measurement, ps, options = timeline_options)
self.assertEquals(0, len(results.failures))
for interval in timeline.IntervalNames:
for category in timeline.TimelineThreadCategories.values():
cpu_time_name = timeline.ThreadCpuTimeResultName(category, interval)
cpu_time = results.FindAllPageSpecificValuesNamed(cpu_time_name)
self.assertEquals(len(cpu_time), 1)
@decorators.Disabled('chromeos') # crbug.com/483212
def testWithSilkDetails(self):
ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html')
......
......@@ -5,7 +5,6 @@
from telemetry.core.platform import tracing_category_filter
from telemetry.core.platform import tracing_options
from telemetry.page import action_runner
from telemetry.page import page_test
from telemetry.timeline.model import TimelineModel
from telemetry.value import trace
from telemetry.web_perf import smooth_gesture_util
......@@ -16,14 +15,13 @@ RUN_SMOOTH_ACTIONS = 'RunSmoothAllActions'
class TimelineController(object):
def __init__(self, enable_auto_issuing_record=True):
def __init__(self):
super(TimelineController, self).__init__()
self.trace_categories = None
self._model = None
self._renderer_process = None
self._smooth_records = []
self._interaction = None
self._enable_auto_issuing_record = enable_auto_issuing_record
def SetUp(self, page, tab):
"""Starts gathering timeline data.
......@@ -45,14 +43,12 @@ class TimelineController(object):
def Start(self, tab):
# Start the smooth marker for all actions.
runner = action_runner.ActionRunner(tab)
if self._enable_auto_issuing_record:
self._interaction = runner.CreateInteraction(
RUN_SMOOTH_ACTIONS)
self._interaction.Begin()
def Stop(self, tab, results):
# End the smooth marker for all actions.
if self._enable_auto_issuing_record:
self._interaction.End()
# Stop tracing.
timeline_data = tab.browser.platform.tracing_controller.Stop()
......@@ -85,9 +81,6 @@ class TimelineController(object):
if len(self._smooth_records) == 0 and run_smooth_actions_record:
self._smooth_records = [run_smooth_actions_record]
if len(self._smooth_records) == 0:
raise page_test.Failure('No interaction record was created.')
def CleanUp(self, tab):
if tab.browser.platform.tracing_controller.is_tracing_running:
......
......@@ -33,7 +33,6 @@ class KeyIdlePowerPage(page_module.Page):
def RunPageInteractions(self, action_runner):
# The page interaction is simply waiting in an idle state.
with action_runner.CreateInteraction('IdleWaiting'):
action_runner.Wait(20)
......
......@@ -35,7 +35,6 @@ class ToughCompositorWaitPage(ToughCompositorPage):
def RunPageInteractions(self, action_runner):
# We scroll back and forth a few times to reduce noise in the tests.
with action_runner.CreateInteraction('Animation'):
action_runner.Wait(8)
......
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