+ def testArchiveInfoFileGetsUpdated(self):
+ """Ensures that the archive info file is updated correctly."""
+
+ expected_archive_file_contents = {
+ u'description': (u'Describes the Web Page Replay archives for a page'
+ u' set. Don\'t edit by hand! Use record_wpr for'
+ u' updating.'),
+ u'archives': {
+ u'data_003.wpr': [u'Bar', u'http://www.baz.com/'],
+ u'data_001.wpr': [u'Foo']
+ }
+ }
+
+ new_temp_recording = os.path.join(self.tmp_dir, 'recording.wpr')
+ with open(new_temp_recording, 'w') as f:
+ f.write('wpr data')
+ self.archive_info.AddNewTemporaryRecording(new_temp_recording)
+ self.archive_info.AddRecordedPages([page2, page3])
+
+ with open(self.page_set_archive_info_file, 'r') as f:
+ archive_file_contents = json.load(f)
+ self.assertEquals(expected_archive_file_contents, archive_file_contents)
+