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 from telemetry import web_contents | 4 from telemetry.core import web_contents |
5 | 5 |
6 DEFAULT_TAB_TIMEOUT = 60 | 6 DEFAULT_TAB_TIMEOUT = 60 |
7 | 7 |
8 class Tab(web_contents.WebContents): | 8 class Tab(web_contents.WebContents): |
9 """Represents a tab in the browser | 9 """Represents a tab in the browser |
10 | 10 |
11 The important parts of the Tab object are in the runtime and page objects. | 11 The important parts of the Tab object are in the runtime and page objects. |
12 E.g.: | 12 E.g.: |
13 # Navigates the tab to a given url. | 13 # Navigates the tab to a given url. |
14 tab.Navigate('http://www.google.com/') | 14 tab.Navigate('http://www.google.com/') |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 self._inspector_backend.PerformActionAndWaitForNavigate( | 70 self._inspector_backend.PerformActionAndWaitForNavigate( |
71 action_function, timeout) | 71 action_function, timeout) |
72 | 72 |
73 def Navigate(self, url, timeout=DEFAULT_TAB_TIMEOUT): | 73 def Navigate(self, url, timeout=DEFAULT_TAB_TIMEOUT): |
74 """Navigates to url.""" | 74 """Navigates to url.""" |
75 self._inspector_backend.Navigate(url, timeout) | 75 self._inspector_backend.Navigate(url, timeout) |
76 | 76 |
77 def GetCookieByName(self, name, timeout=DEFAULT_TAB_TIMEOUT): | 77 def GetCookieByName(self, name, timeout=DEFAULT_TAB_TIMEOUT): |
78 """Returns the value of the cookie by the given |name|.""" | 78 """Returns the value of the cookie by the given |name|.""" |
79 return self._inspector_backend.GetCookieByName(name, timeout) | 79 return self._inspector_backend.GetCookieByName(name, timeout) |
OLD | NEW |