| 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_FRAME_TEST_AUTOMATION_CLIENT_MOCK_H_ | 5 #ifndef CHROME_FRAME_TEST_AUTOMATION_CLIENT_MOCK_H_ |
| 6 #define CHROME_FRAME_TEST_AUTOMATION_CLIENT_MOCK_H_ | 6 #define CHROME_FRAME_TEST_AUTOMATION_CLIENT_MOCK_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 MOCK_METHOD1(SendProxyConfig, void(const std::string&)); | 98 MOCK_METHOD1(SendProxyConfig, void(const std::string&)); |
| 99 | 99 |
| 100 ~MockAutomationProxy() {} | 100 ~MockAutomationProxy() {} |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 struct MockAutomationMessageSender : public AutomationMessageSender { | 103 struct MockAutomationMessageSender : public AutomationMessageSender { |
| 104 virtual bool Send(IPC::Message* msg) { | 104 virtual bool Send(IPC::Message* msg) { |
| 105 return proxy_->Send(msg); | 105 return proxy_->Send(msg); |
| 106 } | 106 } |
| 107 | 107 |
| 108 virtual bool Send(IPC::Message* msg, int timeout_ms) { |
| 109 return proxy_->Send(msg); |
| 110 } |
| 111 |
| 108 void ForwardTo(StrictMock<MockAutomationProxy> *p) { | 112 void ForwardTo(StrictMock<MockAutomationProxy> *p) { |
| 109 proxy_ = p; | 113 proxy_ = p; |
| 110 } | 114 } |
| 111 | 115 |
| 112 StrictMock<MockAutomationProxy>* proxy_; | 116 StrictMock<MockAutomationProxy>* proxy_; |
| 113 }; | 117 }; |
| 114 | 118 |
| 115 // [CFAC] -- uses a ProxyFactory for creation of ChromeFrameAutomationProxy | 119 // [CFAC] -- uses a ProxyFactory for creation of ChromeFrameAutomationProxy |
| 116 // -- uses ChromeFrameAutomationProxy | 120 // -- uses ChromeFrameAutomationProxy |
| 117 // -- uses TabProxy obtained from ChromeFrameAutomationProxy | 121 // -- uses TabProxy obtained from ChromeFrameAutomationProxy |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 virtual void SetUp() { | 178 virtual void SetUp() { |
| 175 dummy_sender_.ForwardTo(&mock_proxy_); | 179 dummy_sender_.ForwardTo(&mock_proxy_); |
| 176 tracker_.reset(new AutomationHandleTracker()); | 180 tracker_.reset(new AutomationHandleTracker()); |
| 177 | 181 |
| 178 client_ = new ChromeFrameAutomationClient; | 182 client_ = new ChromeFrameAutomationClient; |
| 179 client_->set_proxy_factory(&factory_); | 183 client_->set_proxy_factory(&factory_); |
| 180 } | 184 } |
| 181 }; | 185 }; |
| 182 | 186 |
| 183 #endif // CHROME_FRAME_TEST_AUTOMATION_CLIENT_MOCK_H_ | 187 #endif // CHROME_FRAME_TEST_AUTOMATION_CLIENT_MOCK_H_ |
| OLD | NEW |