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

Unified Diff: tools/telemetry/telemetry/block_page_benchmark_results_unittest.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/block_page_benchmark_results.py ('k') | tools/telemetry/telemetry/browser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/block_page_benchmark_results_unittest.py
diff --git a/tools/telemetry/telemetry/block_page_benchmark_results_unittest.py b/tools/telemetry/telemetry/block_page_benchmark_results_unittest.py
deleted file mode 100644
index ba4c02e5a8a99392bcfe5ae163db9cc0d680b756..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/block_page_benchmark_results_unittest.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-import StringIO
-import os
-import unittest
-
-from telemetry import block_page_benchmark_results
-from telemetry.page_set import PageSet
-
-BlockPageBenchmarkResults = \
- block_page_benchmark_results.BlockPageBenchmarkResults
-
-def _MakePageSet():
- return PageSet.FromDict({
- "description": "hello",
- "archive_path": "foo.wpr",
- "pages": [
- {"url": "http://www.foo.com/"},
- {"url": "http://www.bar.com/"}
- ]
- }, os.path.dirname(__file__))
-
-class NonPrintingBlockPageBenchmarkResults(BlockPageBenchmarkResults):
- def __init__(self, *args):
- super(NonPrintingBlockPageBenchmarkResults, self).__init__(*args)
-
- def _PrintPerfResult(self, *args):
- pass
-
-class BlockPageBenchmarkResultsTest(unittest.TestCase):
- def setUp(self):
- self._output = StringIO.StringIO()
- self._page_set = _MakePageSet()
-
- @property
- def lines(self):
- lines = StringIO.StringIO(self._output.getvalue()).readlines()
- return [line.strip() for line in lines]
-
- @property
- def data(self):
- return [line.split(': ', 1) for line in self.lines]
-
- def test_with_output_after_every_page(self):
- results = NonPrintingBlockPageBenchmarkResults(self._output)
- results.WillMeasurePage(self._page_set[0])
- results.Add('foo', 'seconds', 3)
- results.DidMeasurePage()
-
- results.WillMeasurePage(self._page_set[1])
- results.Add('bar', 'seconds', 4)
- results.DidMeasurePage()
-
- expected = [
- ['url', 'http://www.foo.com/'],
- ['foo (seconds)', '3'],
- [''],
- ['url', 'http://www.bar.com/'],
- ['bar (seconds)', '4'],
- ['']
- ]
- self.assertEquals(self.data, expected)
« no previous file with comments | « tools/telemetry/telemetry/block_page_benchmark_results.py ('k') | tools/telemetry/telemetry/browser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698