diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 22:54:01 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 22:54:01 +0000 |
commit | ccd22a77a320bb0fc414a97d758fc002f40a907e (patch) | |
tree | dea1a165c750e29aa7cd091e02a139cf97a952ba /chrome_frame/test/proxy_factory_mock.h | |
parent | 4bc818e1dc285910638203a0d94063a9e92e36b0 (diff) | |
download | chromium_src-ccd22a77a320bb0fc414a97d758fc002f40a907e.zip chromium_src-ccd22a77a320bb0fc414a97d758fc002f40a907e.tar.gz chromium_src-ccd22a77a320bb0fc414a97d758fc002f40a907e.tar.bz2 |
Reorganize chrome_frame_unittest.h/cc
Split this monsterinto 4 different h/cc files based
on the type of tests. No real code changes. Things
should become easier to find/manage now.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/574006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38144 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/proxy_factory_mock.h')
-rw-r--r-- | chrome_frame/test/proxy_factory_mock.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/chrome_frame/test/proxy_factory_mock.h b/chrome_frame/test/proxy_factory_mock.h new file mode 100644 index 0000000..8f2bb2e --- /dev/null +++ b/chrome_frame/test/proxy_factory_mock.h @@ -0,0 +1,43 @@ +// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#ifndef CHROME_FRAME_PROXY_FACTORY_MOCK_H_ +#define CHROME_FRAME_PROXY_FACTORY_MOCK_H_ + +#include <windows.h> +#include <string> + +#include "gmock/gmock.h" +#include "chrome_frame/chrome_frame_automation.h" + +struct LaunchDelegateMock : public ProxyFactory::LaunchDelegate { + MOCK_METHOD2(LaunchComplete, void(ChromeFrameAutomationProxy*, + AutomationLaunchResult)); +}; + +class MockProxyFactory : public ProxyFactory { + public: + MOCK_METHOD3(GetAutomationServer, void (ProxyFactory::LaunchDelegate*, + const ChromeFrameLaunchParams& params, void** automation_server_id)); + MOCK_METHOD1(ReleaseAutomationServer, bool(void* id)); + + MockProxyFactory() : thread_("mock factory worker") { + thread_.Start(); + loop_ = thread_.message_loop(); + } + + // Fake implementation + void GetServerImpl(ChromeFrameAutomationProxy* pxy, + void* proxy_id, + AutomationLaunchResult result, + LaunchDelegate* d, + const ChromeFrameLaunchParams& params, + void** automation_server_id); + + base::Thread thread_; + MessageLoop* loop_; +}; + + +#endif // CHROME_FRAME_PROXY_FACTORY_MOCK_H_ + |