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

Side by Side Diff: tools/perf/measurements/page_cycler_unittest.py

Issue 23480018: Fix page_cycler unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « tools/bisect-manual-test.py ('k') | tools/run-bisect-manual-test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 unittest 4 import unittest
5 5
6 from measurements import page_cycler 6 from measurements import page_cycler
7 from telemetry.core import browser_options 7 from telemetry.core import browser_options
8 from telemetry.page import page_measurement_results 8 from telemetry.page import page_measurement_results
9 from telemetry.unittest import simple_mock 9 from telemetry.unittest import simple_mock
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 class PageCyclerUnitTest(unittest.TestCase): 32 class PageCyclerUnitTest(unittest.TestCase):
33 33
34 # TODO(tonyg): Remove this backfill when we can assume python 2.7 everywhere. 34 # TODO(tonyg): Remove this backfill when we can assume python 2.7 everywhere.
35 def assertIn(self, first, second, msg=None): 35 def assertIn(self, first, second, msg=None):
36 self.assertTrue(first in second, 36 self.assertTrue(first in second,
37 msg="'%s' not found in '%s'" % (first, second)) 37 msg="'%s' not found in '%s'" % (first, second))
38 38
39 def setupCycler(self, args): 39 def setupCycler(self, args):
40 cycler = page_cycler.PageCycler() 40 cycler = page_cycler.PageCycler()
41 options = browser_options.BrowserOptions() 41 options = browser_options.BrowserFinderOptions()
42 parser = options.CreateParser() 42 parser = options.CreateParser()
43 cycler.AddCommandLineOptions(parser) 43 cycler.AddCommandLineOptions(parser)
44 parser.parse_args(args) 44 parser.parse_args(args)
45 cycler.CustomizeBrowserOptions(options) 45 cycler.CustomizeBrowserOptions(options)
46 46
47 return cycler 47 return cycler
48 48
49 def testOptionsColdLoadNoArgs(self): 49 def testOptionsColdLoadNoArgs(self):
50 cycler = self.setupCycler([]) 50 cycler = self.setupCycler([])
51 51
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 results.DidMeasurePage() 124 results.DidMeasurePage()
125 self.assertEqual(num_results+1, len(results.page_results)) 125 self.assertEqual(num_results+1, len(results.page_results))
126 result = results[-1] 126 result = results[-1]
127 self.assertEqual(result.page, page) 127 self.assertEqual(result.page, page)
128 self.assertEqual(1, len(result.values)) 128 self.assertEqual(1, len(result.values))
129 self.assertEqual(result.values[0].trace_name, 'page_load_time') 129 self.assertEqual(result.values[0].trace_name, 'page_load_time')
130 self.assertEqual(result.values[0].units, 'ms') 130 self.assertEqual(result.values[0].units, 'ms')
131 self.assertEqual(result.values[0].chart_name, 131 self.assertEqual(result.values[0].chart_name,
132 'warm_times' if i < 3 else 'cold_times') 132 'warm_times' if i < 3 else 'cold_times')
133 cycler.DidNavigateToPage(page, tab) 133 cycler.DidNavigateToPage(page, tab)
OLDNEW
« no previous file with comments | « tools/bisect-manual-test.py ('k') | tools/run-bisect-manual-test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698