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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/compound_interaction_unittest.py

Issue 11369075: Chrome remote control multipage tests: Add interactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpler. Created 8 years, 1 month 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/chrome_remote_control/chrome_remote_control/compound_interaction_unittest.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/compound_interaction_unittest.py b/tools/chrome_remote_control/chrome_remote_control/compound_interaction_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..e579a96157cc5d9fc478884f74e54c5bcfe48e3b
--- /dev/null
+++ b/tools/chrome_remote_control/chrome_remote_control/compound_interaction_unittest.py
@@ -0,0 +1,42 @@
+# 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 chrome_remote_control import compound_interaction
+from chrome_remote_control import page_interaction
+from chrome_remote_control import tab_test_case
+
+class CompoundInteractionTest(tab_test_case.TabTestCase):
+ interaction1_called = False
+ interaction2_called = False
+
+ def __init__(self, *args):
+ super(CompoundInteractionTest, self).__init__(*args)
+
+ def testCompoundInteraction(self):
+
+ class MockInteraction1(page_interaction.PageInteraction):
+ def PerformInteraction(self, page, tab):
+ CompoundInteractionTest.interaction1_called = True
+
+ class MockInteraction2(page_interaction.PageInteraction):
+ def PerformInteraction(self, page, tab):
+ CompoundInteractionTest.interaction2_called = True
+
+ page_interaction.RegisterClass('mock1', MockInteraction1)
+ page_interaction.RegisterClass('mock2', MockInteraction2)
+
+ i = compound_interaction.CompoundInteraction({
+ 'action': 'compound',
+ 'actions': [
+ {
+ 'action': 'mock1'
+ },
+ {
+ 'action': 'mock2'
+ }
+ ]
+ })
+ i.PerformInteraction({}, self._tab)
+ self.assertTrue(CompoundInteractionTest.interaction1_called)
+ self.assertTrue(CompoundInteractionTest.interaction2_called)

Powered by Google App Engine
This is Rietveld 408576698