Index: tools/chrome_remote_control/chrome_remote_control/page_interaction.py |
diff --git a/tools/chrome_remote_control/chrome_remote_control/page_interaction.py b/tools/chrome_remote_control/chrome_remote_control/page_interaction.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e77b8f953147ebf96cb728ea5c64b2e5004cdc4d |
--- /dev/null |
+++ b/tools/chrome_remote_control/chrome_remote_control/page_interaction.py |
@@ -0,0 +1,36 @@ |
+# 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 PageInteractionNotSupported(Exception): |
+ pass |
+ |
+class PageInteractionFailed(Exception): |
+ pass |
+ |
+class PageInteraction(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() |
+ |
+_page_interaction_classes = {} |
+def GetAllClasses(): |
+ return list(_page_interaction_classes.values()) |
+ |
+def FindClassWithName(name): |
+ return _page_interaction_classes.get(name) |
+ |
+def RegisterClass(name, interaction_class): |
+ assert name not in _page_interaction_classes |
+ _page_interaction_classes[name] = interaction_class |