Index: tools/chrome_remote_control/chrome_remote_control/interaction.py |
diff --git a/tools/chrome_remote_control/chrome_remote_control/interaction.py b/tools/chrome_remote_control/chrome_remote_control/interaction.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..186c746e4384a926564ab3137908f623e25ac214 |
--- /dev/null |
+++ b/tools/chrome_remote_control/chrome_remote_control/interaction.py |
@@ -0,0 +1,32 @@ |
+# 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. |
+class InteractionNotSupported(Exception): |
+ pass |
+ |
+class Interaction(object): |
+ """Represents an interaction that a user might try to perform to a page.""" |
+ |
+ def CustomizeBrowserOptions(self, options): |
+ """Override to add test-specific options to the BrowserOptions object""" |
+ pass |
+ |
+ def SupportedForPage(self, page, tab): |
+ raise NotImplementedError() |
+ |
+ def PerformInteraction(self, page, tab, test): |
+ raise NotImplementedError() |
+ |
+ def CleanUp(self, page, tab): |
+ raise NotImplementedError() |
+ |
+_interaction_classes = {} |
+def GetAllClasses(): |
+ return list(_interaction_classes.values()) |
+ |
+def FindClassWithName(name): |
+ return _interaction_classes.get(name) |
+ |
+def RegisterClass(name, interaction_class): |
+ assert name not in _interaction_classes |
+ _interaction_classes[name] = interaction_class |