- add sources.
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / core / extension_page.py
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
3 # found in the LICENSE file.
4 from telemetry.core import web_contents
5
6 class ExtensionPage(web_contents.WebContents):
7   """Represents a an extension page in the browser"""
8   def __init__(self, extension_id, url, inspector_backend):
9     super(ExtensionPage, self).__init__(inspector_backend)
10     self.extension_id = extension_id
11     self.url = url
12     assert url.startswith('chrome-extension://' + extension_id)
13
14   def __del__(self):
15     super(ExtensionPage, self).__del__()
16
17   def Reload(self):
18     """ Reloading an extension page is used as a workaround for an extension
19     binding bug for old versions of Chrome (crbug.com/263162). After Navigate
20     returns, we are guaranteed that the inspected page is in the correct state.
21     """
22     self._inspector_backend.Navigate(self.url, None, 10)