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

Unified Diff: telemetry/telemetry/wpr/archive_info_unittest.py

Issue 2626373004: [WPR] Implement platform dependent recordings for WPR archives. (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « telemetry/telemetry/wpr/archive_info2_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/wpr/archive_info_unittest.py
diff --git a/telemetry/telemetry/wpr/archive_info_unittest.py b/telemetry/telemetry/wpr/archive_info_unittest.py
index 1a78fee475f4bb38dd6ce8eb41a69e736a5d22e8..9ac7cf0532cf7b8ff081281442698111d3bd1890 100644
--- a/telemetry/telemetry/wpr/archive_info_unittest.py
+++ b/telemetry/telemetry/wpr/archive_info_unittest.py
@@ -12,6 +12,7 @@ from py_utils import cloud_storage # pylint: disable=import-error
from telemetry.page import page
from telemetry.testing import system_stub
from telemetry.wpr import archive_info
+from telemetry.wpr import archive_info2
class MockPage(page.Page):
@@ -227,3 +228,24 @@ class WprArchiveInfoTest(unittest.TestCase):
self.story_set_archive_info_file, cloud_storage.PUBLIC_BUCKET)
self.assertEquals(new_recording,
read_archive_info.WprFilePathForStory(page1))
+
+ def testFromFileMultiplatform(self):
+ multiplatform_archive_info_contents = ("""
+ {
+ "platform_specific": true,
+ "archives": {
+ "%s": ["%s", "%s"],
+ "%s": ["%s"]
+ }
+ }
+ """ % (recording1, page1.display_name, page2.display_name, recording2,
+ page3.display_name))
+
+ archive_info_file = os.path.join(
+ self.tmp_dir, 'info2.json')
+ with open(archive_info_file, 'w') as f:
+ f.write(multiplatform_archive_info_contents)
+
+ archive = archive_info.WprArchiveInfo.FromFile(
+ archive_info_file, cloud_storage.PUBLIC_BUCKET)
+ self.assertTrue(isinstance(archive, archive_info2.WprArchiveInfo))
« no previous file with comments | « telemetry/telemetry/wpr/archive_info2_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698