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 3 # found in the LICENSE file. 4 # pylint: disable=W0401,W0614 5 from telemetry.page.actions.all_page_actions import * 6 from telemetry.page import page as page_module 7 from telemetry.page import page_set as page_set_module 8 9 10 class ToughDomMemoryCasesPage(page_module.Page): 11 12 def __init__(self, url, page_set): 13 super(ToughDomMemoryCasesPage, self).__init__(url=url, page_set=page_set) 14 self.user_agent_type = 'desktop' 15 self.archive_data_file = 'data/tough_dom_memory_cases.json' 16 17 def RunStressMemory(self, action_runner): 18 action_runner.RunAction(ScrollAction()) 19 20 class ToughDomMemoryCasesPageSet(page_set_module.PageSet): 21 22 """ 23 Websites in top 25 where some DOM objects seem to remain even 24 after closing the page. 25 """ 26 27 def __init__(self): 28 super(ToughDomMemoryCasesPageSet, self).__init__( 29 user_agent_type='desktop', 30 archive_data_file='data/tough_dom_memory_cases.json', 31 bucket=page_set_module.PARTNER_BUCKET) 32 33 urls_list = [ 34 # pylint: disable=C0301 35 'http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/', 36 # pylint: disable=C0301 37 'http://en.blog.wordpress.com/2012/09/06/new-themes-gridspace-and-ascetica/', 38 # pylint: disable=C0301 39 'http://en.blog.wordpress.com/2012/09/20/new-themes-gigawatt-and-pinboard/', 40 # pylint: disable=C0301 41 'https://twitter.com/katyperry', 42 'https://twitter.com/justinbieber', 43 'https://twitter.com/BarackObama', 44 'https://twitter.com/ladygaga' 45 ] 46 47 for url in urls_list: 48 self.AddPage(ToughDomMemoryCasesPage(url, self)) 49