OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 bool ExecuteAndExtractBool(const std::wstring& frame_xpath, | 76 bool ExecuteAndExtractBool(const std::wstring& frame_xpath, |
77 const std::wstring& jscript, | 77 const std::wstring& jscript, |
78 bool* value); | 78 bool* value); |
79 bool ExecuteAndExtractInt(const std::wstring& frame_xpath, | 79 bool ExecuteAndExtractInt(const std::wstring& frame_xpath, |
80 const std::wstring& jscript, | 80 const std::wstring& jscript, |
81 int* value); | 81 int* value); |
82 bool ExecuteAndExtractValue(const std::wstring& frame_xpath, | 82 bool ExecuteAndExtractValue(const std::wstring& frame_xpath, |
83 const std::wstring& jscript, | 83 const std::wstring& jscript, |
84 Value** value); | 84 Value** value); |
85 | 85 |
| 86 // Configure extension automation mode. When extension automation |
| 87 // mode is turned on, the automation host can overtake extension API calls |
| 88 // e.g. to make UI tests for extensions easier to write. Returns true if |
| 89 // the message is successfully sent. |
| 90 // |
| 91 // Note that API calls in _any_ extension view will be routed to the current |
| 92 // tab. This is to enable UI testing of e.g. extension background pages. |
| 93 // |
| 94 // Enabling extension automation from more than one tab is an error. |
| 95 // |
| 96 // You must disable extension automation before destroying the tab. |
| 97 // |
| 98 // The parameter can take the following types of values: |
| 99 // a) An empty list to turn off extension automation. |
| 100 // b) A list with one item, "*", to turn extension automation on for all |
| 101 // functions. |
| 102 // c) A list with one or more items which are the names of Chrome Extension |
| 103 // API functions that should be forwarded over the automation interface. |
| 104 // Other functions will continue to be fulfilled as normal. This lets you |
| 105 // write tests where some functionality continues to function as normal, |
| 106 // and other functionality is mocked out by the test. |
| 107 bool SetEnableExtensionAutomation( |
| 108 const std::vector<std::string>& functions_enabled); |
| 109 |
86 // Navigates to a url. This method accepts the same kinds of URL input that | 110 // Navigates to a url. This method accepts the same kinds of URL input that |
87 // can be passed to Chrome on the command line. This is a synchronous call and | 111 // can be passed to Chrome on the command line. This is a synchronous call and |
88 // hence blocks until the navigation completes. | 112 // hence blocks until the navigation completes. |
89 AutomationMsg_NavigationResponseValues NavigateToURL( | 113 AutomationMsg_NavigationResponseValues NavigateToURL( |
90 const GURL& url); | 114 const GURL& url); |
91 | 115 |
92 // Navigates to a url. This method accepts the same kinds of URL input that | 116 // Navigates to a url. This method accepts the same kinds of URL input that |
93 // can be passed to Chrome on the command line. This is a synchronous call and | 117 // can be passed to Chrome on the command line. This is a synchronous call and |
94 // hence blocks until the |number_of_navigations| navigations complete. | 118 // hence blocks until the |number_of_navigations| navigations complete. |
95 AutomationMsg_NavigationResponseValues | 119 AutomationMsg_NavigationResponseValues |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 void OnMessageReceived(const IPC::Message& message); | 373 void OnMessageReceived(const IPC::Message& message); |
350 protected: | 374 protected: |
351 virtual ~TabProxy() {} | 375 virtual ~TabProxy() {} |
352 private: | 376 private: |
353 Lock list_lock_; // Protects the observers_list_. | 377 Lock list_lock_; // Protects the observers_list_. |
354 ObserverList<TabProxyDelegate> observers_list_; | 378 ObserverList<TabProxyDelegate> observers_list_; |
355 DISALLOW_COPY_AND_ASSIGN(TabProxy); | 379 DISALLOW_COPY_AND_ASSIGN(TabProxy); |
356 }; | 380 }; |
357 | 381 |
358 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 382 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
OLD | NEW |