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

Side by Side Diff: tools/telemetry/telemetry/testing/story_set_smoke_test.py

Issue 1244223002: Create classes_util API, change discover to return a list instead of a dict. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « tools/telemetry/telemetry/record_wpr.py ('k') | tools/telemetry/telemetry/util/classes_util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 discover
10 from telemetry.internal.browser import browser_credentials 9 from telemetry.internal.browser import browser_credentials
11 from telemetry import page 10 from telemetry import page
12 from telemetry import story as story_module 11 from telemetry import story as story_module
12 from telemetry.util import classes_util
13 from telemetry.wpr import archive_info 13 from telemetry.wpr import archive_info
14 14
15 15
16 class StorySetSmokeTest(unittest.TestCase): 16 class StorySetSmokeTest(unittest.TestCase):
17 17
18 def setUp(self): 18 def setUp(self):
19 # Make sure the added failure message is appended to the default failure 19 # Make sure the added failure message is appended to the default failure
20 # message. 20 # message.
21 self.longMessage = True 21 self.longMessage = True
22 22
23 def GetAllStorySetClasses(self, story_sets_dir, top_level_dir): 23 def GetAllStorySetClasses(self, story_sets_dir, top_level_dir):
24 # We can't test page sets that aren't directly constructable since we 24 # We can't test page sets that aren't directly constructable since we
25 # don't know what arguments to put for the constructor. 25 # don't know what arguments to put for the constructor.
26 return discover.DiscoverClasses(story_sets_dir, top_level_dir, 26 return classes_util.DiscoverClasses(story_sets_dir, top_level_dir,
27 story_module.StorySet, 27 story_module.StorySet,
28 directly_constructable=True).values() 28 directly_constructable=True)
29 29
30 def CheckArchive(self, story_set): 30 def CheckArchive(self, story_set):
31 """Verify that all URLs of pages in story_set have an associated archive.""" 31 """Verify that all URLs of pages in story_set have an associated archive."""
32 # TODO: Eventually these should be fatal. 32 # TODO: Eventually these should be fatal.
33 if not story_set.archive_data_file: 33 if not story_set.archive_data_file:
34 logging.warning('Skipping %s: no archive data file', story_set.file_path) 34 logging.warning('Skipping %s: no archive data file', story_set.file_path)
35 return 35 return
36 36
37 logging.info('Testing %s', story_set.file_path) 37 logging.info('Testing %s', story_set.file_path)
38 38
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 method to run smoke test. 134 method to run smoke test.
135 """ 135 """
136 story_sets = self.GetAllStorySetClasses(story_sets_dir, top_level_dir) 136 story_sets = self.GetAllStorySetClasses(story_sets_dir, top_level_dir)
137 for story_set_class in story_sets: 137 for story_set_class in story_sets:
138 story_set = story_set_class() 138 story_set = story_set_class()
139 logging.info('Testing %s', story_set.file_path) 139 logging.info('Testing %s', story_set.file_path)
140 self.CheckArchive(story_set) 140 self.CheckArchive(story_set)
141 self.CheckCredentials(story_set) 141 self.CheckCredentials(story_set)
142 self.CheckAttributes(story_set) 142 self.CheckAttributes(story_set)
143 self.CheckSharedStates(story_set) 143 self.CheckSharedStates(story_set)
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/record_wpr.py ('k') | tools/telemetry/telemetry/util/classes_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698