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

Unified Diff: tools/telemetry/telemetry/page/compound_action_unittest.py

Issue 12294002: Revert 182991 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
Index: tools/telemetry/telemetry/page/compound_action_unittest.py
===================================================================
--- tools/telemetry/telemetry/page/compound_action_unittest.py (revision 182999)
+++ tools/telemetry/telemetry/page/compound_action_unittest.py (working copy)
@@ -1,78 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-from telemetry.page import all_page_actions
-from telemetry.page import compound_action
-from telemetry.page import page_action
-from telemetry.test import tab_test_case
-
-class AppendAction(page_action.PageAction):
- def RunAction(self, page, tab, previous_action):
- self.var.append(True)
-
-class WrapAppendAction(page_action.PageAction):
- def RunsPreviousAction(self):
- return True
-
- def RunAction(self, page, tab, previous_action):
- self.var.append('before')
- previous_action.WillRunAction(page, tab)
- previous_action.RunAction(page, tab, None)
- self.var.append('after')
-
-class CompoundActionTest(tab_test_case.TabTestCase):
- def __init__(self, *args):
- super(CompoundActionTest, self).__init__(*args)
-
- def setUp(self):
- super(CompoundActionTest, self).setUp()
- all_page_actions.RegisterClassForTest('append', AppendAction)
- all_page_actions.RegisterClassForTest('wrap_append', WrapAppendAction)
-
- def testCompoundAction(self):
- action1_called = []
- action2_called = []
- action = compound_action.CompoundAction({
- 'actions': [
- { 'action': 'append', 'var': action1_called },
- { 'action': 'append', 'var': action2_called }
- ]
- })
- action.RunAction(None, self._tab, None)
- self.assertTrue(action1_called)
- self.assertTrue(action2_called)
-
- def testNestedAction(self):
- action = compound_action.CompoundAction({
- 'actions': [
- { 'action': 'compound_action', 'actions': [] }
- ]
- })
- action.RunAction(None, self._tab, None)
-
- def testPreviousAction(self):
- action_list = []
- action = compound_action.CompoundAction({
- 'actions': [
- { 'action': 'append', 'var': action_list },
- { 'action': 'wrap_append', 'var': action_list }
- ]
- })
- action.RunAction(None, self._tab, None)
- self.assertEqual(action_list, ['before', True, 'after'])
-
- def testNestedPreviousAction(self):
- action_list = []
- action = compound_action.CompoundAction({
- 'actions': [
- { 'action': 'append', 'var': action_list },
- {
- 'action': 'compound_action',
- 'actions': [
- { 'action': 'wrap_append', 'var': action_list }
- ]
- }
- ]
- })
- action.RunAction(None, self._tab, None)
- self.assertEqual(action_list, ['before', True, 'after'])
« no previous file with comments | « tools/telemetry/telemetry/page/compound_action.py ('k') | tools/telemetry/telemetry/page/csv_page_benchmark_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698