| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 4 |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import unittest | 7 import unittest |
| 8 | 8 |
| 9 from telemetry.core import browser_credentials | 9 from telemetry.core import browser_credentials |
| 10 from telemetry.core import discover | 10 from telemetry.core import discover |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 logging.info('Testing %s', page_set.file_path) | 25 logging.info('Testing %s', page_set.file_path) |
| 26 | 26 |
| 27 archive_data_file_path = os.path.join(page_set.base_dir, | 27 archive_data_file_path = os.path.join(page_set.base_dir, |
| 28 page_set.archive_data_file) | 28 page_set.archive_data_file) |
| 29 self.assertTrue(os.path.exists(archive_data_file_path), | 29 self.assertTrue(os.path.exists(archive_data_file_path), |
| 30 msg='Archive data file not found for %s' % | 30 msg='Archive data file not found for %s' % |
| 31 page_set.file_path) | 31 page_set.file_path) |
| 32 | 32 |
| 33 wpr_archive_info = archive_info.WprArchiveInfo.FromFile( | 33 wpr_archive_info = archive_info.WprArchiveInfo.FromFile( |
| 34 archive_data_file_path, page_set.bucket, ignore_archive=True) | 34 archive_data_file_path, page_set.bucket) |
| 35 for page in page_set.pages: | 35 for page in page_set.pages: |
| 36 if not page.url.startswith('http'): | 36 if not page.url.startswith('http'): |
| 37 continue | 37 continue |
| 38 self.assertTrue(wpr_archive_info.WprFilePathForUserStory(page), | 38 self.assertTrue(wpr_archive_info.WprFilePathForUserStory(page), |
| 39 msg='No archive found for %s in %s' % ( | 39 msg='No archive found for %s in %s' % ( |
| 40 page.url, page_set.archive_data_file)) | 40 page.url, page_set.archive_data_file)) |
| 41 | 41 |
| 42 def CheckCredentials(self, page_set): | 42 def CheckCredentials(self, page_set): |
| 43 """Verify that all pages in page_set use proper credentials""" | 43 """Verify that all pages in page_set use proper credentials""" |
| 44 for page in page_set.pages: | 44 for page in page_set.pages: |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if not classes.IsDirectlyConstructable(page_set_class): | 141 if not classes.IsDirectlyConstructable(page_set_class): |
| 142 # We can't test page sets that aren't directly constructable since we | 142 # We can't test page sets that aren't directly constructable since we |
| 143 # don't know what arguments to put for the constructor. | 143 # don't know what arguments to put for the constructor. |
| 144 continue | 144 continue |
| 145 page_set = page_set_class() | 145 page_set = page_set_class() |
| 146 logging.info('Testing %s', page_set.file_path) | 146 logging.info('Testing %s', page_set.file_path) |
| 147 self.CheckArchive(page_set) | 147 self.CheckArchive(page_set) |
| 148 self.CheckCredentials(page_set) | 148 self.CheckCredentials(page_set) |
| 149 self.CheckAttributes(page_set) | 149 self.CheckAttributes(page_set) |
| 150 self.CheckNoMixedInBetweenLegacyRunMethodsAndRunPageInteractions(page_set) | 150 self.CheckNoMixedInBetweenLegacyRunMethodsAndRunPageInteractions(page_set) |
| OLD | NEW |