1# Copyright 2013 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from telemetry.page.actions import page_action 6 7 8class JavascriptAction(page_action.PageAction): 9 def __init__(self, attributes=None): 10 super(JavascriptAction, self).__init__(attributes) 11 12 def RunAction(self, page, tab, previous_action): 13 assert hasattr(self, 'expression') 14 tab.ExecuteJavaScript(self.expression)