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

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

Issue 12088107: Revert 180117, it broke all telemetry tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
Index: tools/telemetry/telemetry/page_set_unittest.py
===================================================================
--- tools/telemetry/telemetry/page_set_unittest.py (revision 180130)
+++ tools/telemetry/telemetry/page_set_unittest.py (working copy)
@@ -1,27 +1,16 @@
# 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 os
import tempfile
import unittest
from telemetry import page_set
-simple_archive_info = """
-{
-"archives": {
- "data_01.wpr": ["http://www.foo.com/"],
- "data_02.wpr": ["http://www.bar.com/"]
-}
-}
-"""
-
simple_set = """
{"description": "hello",
- "archive_data_file": "%s",
+ "archive_path": "foo.wpr",
"pages": [
- {"url": "http://www.foo.com/"},
- {"url": "http://www.bar.com/"}
+ {"url": "http://www.foo.com/"}
]
}
"""
@@ -29,19 +18,11 @@
class TestPageSet(unittest.TestCase):
def testSimpleSet(self):
with tempfile.NamedTemporaryFile() as f:
- f.write(simple_archive_info)
+ f.write(simple_set)
f.flush()
- archive_data_file = f.name
+ ps = page_set.PageSet.FromFile(f.name)
- with tempfile.NamedTemporaryFile() as f2:
- f2.write(simple_set % archive_data_file)
- f2.flush()
- ps = page_set.PageSet.FromFile(f2.name)
-
self.assertEquals('hello', ps.description)
- self.assertEquals(archive_data_file, ps.archive_data_file)
- self.assertEquals(2, len(ps.pages))
+ self.assertEquals('foo.wpr', ps.archive_path)
+ self.assertEquals(1, len(ps.pages))
self.assertEquals('http://www.foo.com/', ps.pages[0].url)
- self.assertEquals('http://www.bar.com/', ps.pages[1].url)
- self.assertEquals('data_01.wpr', os.path.basename(ps.pages[0].archive_path))
- self.assertEquals('data_02.wpr', os.path.basename(ps.pages[1].archive_path))
« no previous file with comments | « tools/telemetry/telemetry/page_set_archive_info_unittest.py ('k') | tools/telemetry/telemetry/page_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698