Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: tools/telemetry/telemetry/web_perf/smooth_gesture_util_unittest.py

Issue 1231643002: [Startup Tracing][Telemetry] Move tracing_options and tracing_category_filter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import time 4 import time
5 import unittest 5 import unittest
6 6
7 from telemetry.core.platform import tracing_category_filter
8 from telemetry.core.platform import tracing_options
9 from telemetry import decorators 7 from telemetry import decorators
10 from telemetry.page import page as page_module 8 from telemetry.page import page as page_module
11 from telemetry.page import page_test 9 from telemetry.page import page_test
12 from telemetry.testing import page_test_test_case 10 from telemetry.testing import page_test_test_case
13 from telemetry.timeline import async_slice 11 from telemetry.timeline import async_slice
14 from telemetry.timeline import model as model_module 12 from telemetry.timeline import model as model_module
13 from telemetry.timeline import tracing_category_filter
14 from telemetry.timeline import tracing_options
15 from telemetry.web_perf import smooth_gesture_util as sg_util 15 from telemetry.web_perf import smooth_gesture_util as sg_util
16 from telemetry.web_perf import timeline_interaction_record as tir_module 16 from telemetry.web_perf import timeline_interaction_record as tir_module
17 17
18 18
19 class SmoothGestureUtilTest(unittest.TestCase): 19 class SmoothGestureUtilTest(unittest.TestCase):
20 def testGetAdjustedInteractionIfContainGesture(self): 20 def testGetAdjustedInteractionIfContainGesture(self):
21 model = model_module.TimelineModel() 21 model = model_module.TimelineModel()
22 renderer_main = model.GetOrCreateProcess(1).GetOrCreateThread(2) 22 renderer_main = model.GetOrCreateProcess(1).GetOrCreateThread(2)
23 renderer_main.name = 'CrRendererMain' 23 renderer_main.name = 'CrRendererMain'
24 24
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 adjusted_smooth_gesture = ( 147 adjusted_smooth_gesture = (
148 sg_util.GetAdjustedInteractionIfContainGesture( 148 sg_util.GetAdjustedInteractionIfContainGesture(
149 timeline_model, smooth_record)) 149 timeline_model, smooth_record))
150 # Test that the scroll gesture starts at at least 500ms after the start of 150 # Test that the scroll gesture starts at at least 500ms after the start of
151 # the interaction record and ends at at least 500ms before the end of 151 # the interaction record and ends at at least 500ms before the end of
152 # interaction record. 152 # interaction record.
153 self.assertLessEqual( 153 self.assertLessEqual(
154 500, adjusted_smooth_gesture.start - smooth_record.start) 154 500, adjusted_smooth_gesture.start - smooth_record.start)
155 self.assertLessEqual( 155 self.assertLessEqual(
156 500, smooth_record.end - adjusted_smooth_gesture.end) 156 500, smooth_record.end - adjusted_smooth_gesture.end)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698