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

Side by Side Diff: telemetry/telemetry/page/shared_page_state.py

Issue 2451713003: Revert of [Telemetry] Remove logic of pulling out user_agent_type from page_set (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4
5 import logging 5 import logging
6 import os 6 import os
7 import sys 7 import sys
8 8
9 from telemetry.core import exceptions 9 from telemetry.core import exceptions
10 from telemetry.core import util 10 from telemetry.core import util
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 assert not 'trace' in finder_options.profiler, ( 51 assert not 'trace' in finder_options.profiler, (
52 'This is a Timeline Based Measurement benchmark. You cannot run it ' 52 'This is a Timeline Based Measurement benchmark. You cannot run it '
53 'with trace profiler enabled. If you need trace data, tracing is ' 53 'with trace profiler enabled. If you need trace data, tracing is '
54 'always enabled in Timeline Based Measurement benchmarks and you ' 54 'always enabled in Timeline Based Measurement benchmarks and you '
55 'can get the trace data by adding --output-format=json.') 55 'can get the trace data by adding --output-format=json.')
56 # This is to avoid the cyclic-import caused by timeline_based_page_test. 56 # This is to avoid the cyclic-import caused by timeline_based_page_test.
57 from telemetry.web_perf import timeline_based_page_test 57 from telemetry.web_perf import timeline_based_page_test
58 self._test = timeline_based_page_test.TimelineBasedPageTest(test) 58 self._test = timeline_based_page_test.TimelineBasedPageTest(test)
59 else: 59 else:
60 self._test = test 60 self._test = test
61 _PrepareFinderOptions(finder_options, self._test, self._device_type) 61 device_type = self._device_type
62 # TODO(aiolos, nednguyen): Remove this logic of pulling out user_agent_type
63 # from story_set once all page_set are converted to story_set
64 # (crbug.com/439512).
65
66 def _IsPageSetInstance(s):
67 # This is needed to avoid importing telemetry.page.page_set which will
68 # cause cyclic import.
69 return 'PageSet' == s.__class__.__name__ or 'PageSet' in (
70 list(c.__name__ for c in s.__class__.__bases__))
71 if not device_type and _IsPageSetInstance(story_set):
72 device_type = story_set.user_agent_type
73 _PrepareFinderOptions(finder_options, self._test, device_type)
62 self._browser = None 74 self._browser = None
63 self._finder_options = finder_options 75 self._finder_options = finder_options
64 self._possible_browser = self._GetPossibleBrowser( 76 self._possible_browser = self._GetPossibleBrowser(
65 self._test, finder_options) 77 self._test, finder_options)
66 78
67 self._first_browser = True 79 self._first_browser = True
68 self._did_login_for_current_page = False 80 self._did_login_for_current_page = False
69 self._previous_page = None 81 self._previous_page = None
70 self._current_page = None 82 self._current_page = None
71 self._current_tab = None 83 self._current_tab = None
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 class SharedDesktopPageState(SharedPageState): 355 class SharedDesktopPageState(SharedPageState):
344 _device_type = 'desktop' 356 _device_type = 'desktop'
345 357
346 358
347 class SharedTabletPageState(SharedPageState): 359 class SharedTabletPageState(SharedPageState):
348 _device_type = 'tablet' 360 _device_type = 'tablet'
349 361
350 362
351 class Shared10InchTabletPageState(SharedPageState): 363 class Shared10InchTabletPageState(SharedPageState):
352 _device_type = 'tablet_10_inch' 364 _device_type = 'tablet_10_inch'
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698