OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 import os | 4 import os |
5 | 5 |
6 from telemetry import discover | 6 from telemetry import discover |
7 from telemetry import page_action | 7 from telemetry import page_action |
8 | 8 |
9 _page_action_classes = discover.Discover(os.path.dirname(__file__), | 9 _page_action_classes = discover.Discover(os.path.dirname(__file__), |
10 'action', | 10 'action', |
11 page_action.PageAction, | 11 page_action.PageAction, |
12 import_error_should_raise=True) | 12 import_error_should_raise=True) |
13 | 13 |
14 def GetAllClasses(): | 14 def GetAllClasses(): |
15 return list(_page_action_classes.values()) | 15 return list(_page_action_classes.values()) |
16 | 16 |
17 def FindClassWithName(name): | 17 def FindClassWithName(name): |
18 return _page_action_classes.get(name) | 18 return _page_action_classes.get(name) |
19 | 19 |
20 def RegisterClassForTest(name, clazz): | 20 def RegisterClassForTest(name, clazz): |
21 _page_action_classes[name] = clazz | 21 _page_action_classes[name] = clazz |
OLD | NEW |