| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 4 |
| 5 #ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
| 6 #define CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 6 #define CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" // NOLINT | 9 #include "build/build_config.h" // NOLINT |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const std::wstring& jscript, | 98 const std::wstring& jscript, |
| 99 int* value) WARN_UNUSED_RESULT; | 99 int* value) WARN_UNUSED_RESULT; |
| 100 bool ExecuteAndExtractValue(const std::wstring& frame_xpath, | 100 bool ExecuteAndExtractValue(const std::wstring& frame_xpath, |
| 101 const std::wstring& jscript, | 101 const std::wstring& jscript, |
| 102 Value** value) WARN_UNUSED_RESULT; | 102 Value** value) WARN_UNUSED_RESULT; |
| 103 | 103 |
| 104 // Returns a DOMElementProxyRef to the tab's current DOM document. | 104 // Returns a DOMElementProxyRef to the tab's current DOM document. |
| 105 // This proxy is invalidated when the document changes. | 105 // This proxy is invalidated when the document changes. |
| 106 DOMElementProxyRef GetDOMDocument(); | 106 DOMElementProxyRef GetDOMDocument(); |
| 107 | 107 |
| 108 // Configure extension automation mode. When extension automation | |
| 109 // mode is turned on, the automation host can overtake extension API calls | |
| 110 // e.g. to make UI tests for extensions easier to write. Returns true if | |
| 111 // the message is successfully sent. | |
| 112 // | |
| 113 // Note that API calls in _any_ extension view will be routed to the current | |
| 114 // tab. This is to enable UI testing of e.g. extension background pages. | |
| 115 // | |
| 116 // Enabling extension automation from more than one tab is an error. | |
| 117 // | |
| 118 // You must disable extension automation before destroying the tab. | |
| 119 // | |
| 120 // The parameter can take the following types of values: | |
| 121 // a) An empty list to turn off extension automation. | |
| 122 // b) A list with one item, "*", to turn extension automation on for all | |
| 123 // functions. | |
| 124 // c) A list with one or more items which are the names of Chrome Extension | |
| 125 // API functions that should be forwarded over the automation interface. | |
| 126 // Other functions will continue to be fulfilled as normal. This lets you | |
| 127 // write tests where some functionality continues to function as normal, | |
| 128 // and other functionality is mocked out by the test. | |
| 129 bool SetEnableExtensionAutomation( | |
| 130 const std::vector<std::string>& functions_enabled) WARN_UNUSED_RESULT; | |
| 131 | |
| 132 // Navigates to a url. This method accepts the same kinds of URL input that | 108 // Navigates to a url. This method accepts the same kinds of URL input that |
| 133 // can be passed to Chrome on the command line. This is a synchronous call and | 109 // can be passed to Chrome on the command line. This is a synchronous call and |
| 134 // hence blocks until the navigation completes. | 110 // hence blocks until the navigation completes. |
| 135 AutomationMsg_NavigationResponseValues NavigateToURL( | 111 AutomationMsg_NavigationResponseValues NavigateToURL( |
| 136 const GURL& url) WARN_UNUSED_RESULT; | 112 const GURL& url) WARN_UNUSED_RESULT; |
| 137 | 113 |
| 138 // Navigates to a url. This method accepts the same kinds of URL input that | 114 // Navigates to a url. This method accepts the same kinds of URL input that |
| 139 // can be passed to Chrome on the command line. This is a synchronous call and | 115 // can be passed to Chrome on the command line. This is a synchronous call and |
| 140 // hence blocks until the |number_of_navigations| navigations complete. | 116 // hence blocks until the |number_of_navigations| navigations complete. |
| 141 AutomationMsg_NavigationResponseValues | 117 AutomationMsg_NavigationResponseValues |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 // purposes. | 413 // purposes. |
| 438 void LastObjectRemoved(); | 414 void LastObjectRemoved(); |
| 439 | 415 |
| 440 private: | 416 private: |
| 441 base::Lock list_lock_; // Protects the observers_list_. | 417 base::Lock list_lock_; // Protects the observers_list_. |
| 442 ObserverList<TabProxyDelegate> observers_list_; | 418 ObserverList<TabProxyDelegate> observers_list_; |
| 443 DISALLOW_COPY_AND_ASSIGN(TabProxy); | 419 DISALLOW_COPY_AND_ASSIGN(TabProxy); |
| 444 }; | 420 }; |
| 445 | 421 |
| 446 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 422 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
| OLD | NEW |