Index: chrome/test/automation/automation_proxy_uitest.cc |
=================================================================== |
--- chrome/test/automation/automation_proxy_uitest.cc (revision 65589) |
+++ chrome/test/automation/automation_proxy_uitest.cc (working copy) |
@@ -25,6 +25,7 @@ |
#include "chrome/test/automation/automation_messages.h" |
#include "chrome/test/automation/automation_proxy_uitest.h" |
#include "chrome/test/automation/browser_proxy.h" |
+#include "chrome/test/automation/proxy_launcher.h" |
#include "chrome/test/automation/tab_proxy.h" |
#include "chrome/test/automation/window_proxy.h" |
#include "chrome/test/ui_test_utils.h" |
@@ -41,6 +42,14 @@ |
using testing::StrEq; |
using testing::_; |
+// Replace the default automation proxy with our mock client. |
+class ExternalTabUITestMockLauncher : public ProxyLauncher { |
+ public: |
+ AutomationProxy* CreateAutomationProxy(int execution_timeout) const { |
+ return new ExternalTabUITestMockClient(execution_timeout); |
+ } |
+}; |
+ |
class AutomationProxyTest : public UITest { |
protected: |
AutomationProxyTest() { |
@@ -834,9 +843,8 @@ |
return reinterpret_cast<T**>(&p); |
} |
-AutomationProxy* ExternalTabUITest::CreateAutomationProxy(int exec_timeout) { |
- mock_ = new ExternalTabUITestMockClient(exec_timeout); |
- return mock_; |
+ProxyLauncher* ExternalTabUITest::CreateProxyLauncher() { |
+ return new ExternalTabUITestMockLauncher(); |
} |
// Create with specifying a url |