| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 os | 5 import os |
| 6 | 6 |
| 7 from page_sets import top_7_stress |
| 8 from page_sets import top_pages |
| 9 from telemetry import story |
| 7 from telemetry.page import shared_page_state | 10 from telemetry.page import shared_page_state |
| 8 from telemetry.page import page_set as page_set_module | |
| 9 | |
| 10 from page_sets import top_pages | |
| 11 from page_sets import top_7_stress | |
| 12 | 11 |
| 13 | 12 |
| 14 def _SpawnTab(action_runner): | 13 def _SpawnTab(action_runner): |
| 15 return action_runner.EvaluateJavaScript('__telemetry_spawn_tab()') | 14 return action_runner.EvaluateJavaScript('__telemetry_spawn_tab()') |
| 16 | 15 |
| 17 | 16 |
| 18 def _CloseTab(action_runner, tab): | 17 def _CloseTab(action_runner, tab): |
| 19 action_runner.EvaluateJavaScript('__telemetry_close_tab(' + str(tab) + ')') | 18 action_runner.EvaluateJavaScript('__telemetry_close_tab(' + str(tab) + ')') |
| 20 | 19 |
| 21 | 20 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 for tab in xrange(MAX_TABS): | 39 for tab in xrange(MAX_TABS): |
| 41 tabs[tab] = _SpawnTab(action_runner) | 40 tabs[tab] = _SpawnTab(action_runner) |
| 42 action_runner.Wait(20) | 41 action_runner.Wait(20) |
| 43 # Quickly close tabs. | 42 # Quickly close tabs. |
| 44 for tab in xrange(MAX_TABS): | 43 for tab in xrange(MAX_TABS): |
| 45 _CloseTab(action_runner, tabs[tab]) | 44 _CloseTab(action_runner, tabs[tab]) |
| 46 action_runner.Wait(30) | 45 action_runner.Wait(30) |
| 47 return DerivedIdleMultiTabPage | 46 return DerivedIdleMultiTabPage |
| 48 | 47 |
| 49 | 48 |
| 50 class IdleMultiTabCasesPageSet(page_set_module.PageSet): | 49 class IdleMultiTabCasesPageSet(story.StorySet): |
| 51 | 50 |
| 52 """ Pages for testing GC efficiency on idle pages. """ | 51 """ Pages for testing GC efficiency on idle pages. """ |
| 53 | 52 |
| 54 def __init__(self): | 53 def __init__(self): |
| 55 super(IdleMultiTabCasesPageSet, self).__init__( | 54 super(IdleMultiTabCasesPageSet, self).__init__( |
| 56 archive_data_file='data/top_25.json', | 55 archive_data_file='data/top_25.json', |
| 57 bucket=page_set_module.PARTNER_BUCKET) | 56 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 58 with open(os.path.join(os.path.dirname(__file__), | 57 with open(os.path.join(os.path.dirname(__file__), |
| 59 'idle_multi_tab_cases.js')) as f: | 58 'idle_multi_tab_cases.js')) as f: |
| 60 base_js = f.read() | 59 base_js = f.read() |
| 61 self.AddUserStory( | 60 self.AddUserStory( |
| 62 _CreateIdleMultiTabPageClass(top_pages.GoogleDocPage, base_js) | 61 _CreateIdleMultiTabPageClass(top_pages.GoogleDocPage, base_js) |
| 63 (self, shared_page_state.SharedDesktopPageState)) | 62 (self, shared_page_state.SharedDesktopPageState)) |
| 64 self.AddUserStory( | 63 self.AddUserStory( |
| 65 _CreateIdleMultiTabPageClass(top_7_stress.GooglePlusPage, base_js) | 64 _CreateIdleMultiTabPageClass(top_7_stress.GooglePlusPage, base_js) |
| 66 (self)) | 65 (self)) |
| OLD | NEW |