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

Unified Diff: tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py

Issue 1010773008: [Telemetry] Update page_set_smoke_test to check for mix states in page set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py
diff --git a/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py b/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py
index 517bf58b751cecfe7f720a497770a4fa48efea71..cc04346e764191b026d8edfd961103b81e8a66b1 100644
--- a/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py
+++ b/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py
@@ -15,6 +15,11 @@ from telemetry.wpr import archive_info
class PageSetSmokeTest(unittest.TestCase):
+ def setUp(self):
+ # Make sure the added failure message is appended to the default failure
+ # message.
+ self.longMessage = True
+
def CheckArchive(self, page_set):
"""Verify that all URLs of pages in page_set have an associated archive. """
# TODO: Eventually these should be fatal.
@@ -107,6 +112,19 @@ class PageSetSmokeTest(unittest.TestCase):
msg='label %s in page %s \'s labels must have type string'
% (str(l), page.display_name))
+ def CheckSharedStates(self, page_set):
+ if not page_set.allow_mixed_story_states:
+ shared_user_story_state_class = (
+ page_set.user_stories[0].shared_user_story_state_class)
+ for p in page_set:
+ self.assertIs(
+ shared_user_story_state_class,
+ p.shared_user_story_state_class,
+ msg='page %s\'s shared_user_story_state_class field is different '
+ 'from other pages\'s shared_user_story_state_class whereas '
+ 'page set %s disallow having mixed states' %
+ (p, page_set))
+
def RunSmokeTest(self, page_sets_dir, top_level_dir):
"""Run smoke test on all page sets in page_sets_dir.
@@ -125,3 +143,4 @@ class PageSetSmokeTest(unittest.TestCase):
self.CheckArchive(page_set)
self.CheckCredentials(page_set)
self.CheckAttributes(page_set)
+ self.CheckSharedStates(page_set)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698