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

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

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. 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
« no previous file with comments | « tools/telemetry/telemetry/compound_action.py ('k') | tools/telemetry/telemetry/core/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/compound_action_unittest.py
diff --git a/tools/telemetry/telemetry/compound_action_unittest.py b/tools/telemetry/telemetry/compound_action_unittest.py
deleted file mode 100644
index 8aaca0098573f94f05e106debb411f5255b9d837..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/compound_action_unittest.py
+++ /dev/null
@@ -1,79 +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 import all_page_actions
-from telemetry import compound_action
-from telemetry import page_action
-from telemetry 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/compound_action.py ('k') | tools/telemetry/telemetry/core/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698