Chromium Code Reviews| 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..3049b4d4548420be155aa70094367423006c7faf |
| --- /dev/null |
| +++ b/tools/chrome_remote_control/chrome_remote_control/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. |
| + |
|
nduca
2012/11/06 05:03:27
interaction -> page_interaction? PageInteraction,
marja
2012/11/06 16:01:21
Done.
|
| +class InteractionNotSupported(Exception): |
| + pass |
| + |
| +class InteractionFailed(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 |