diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 16:55:32 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 16:55:32 +0000 |
commit | 5bbe1597629c0b99b1dd9a80a634bd575bbb2a93 (patch) | |
tree | f39459f508d22ed882d9a1b737e443ad2fd83411 /ash/test/test_metro_viewer_process_host.h | |
parent | 9aa5c51b49de1934e40cd5e2b35b4d7187748e96 (diff) | |
download | chromium_src-5bbe1597629c0b99b1dd9a80a634bd575bbb2a93.zip chromium_src-5bbe1597629c0b99b1dd9a80a634bd575bbb2a93.tar.gz chromium_src-5bbe1597629c0b99b1dd9a80a634bd575bbb2a93.tar.bz2 |
Create MetroViewerProcessHost as a common base for TestMetroViewerProcessHost and ChromeMetroViewerProcessHost
Bringing LaunchViewerAndWaitForConnection() to the common base so that ChromeMetroViewerProcessHost can also benefit from it (required for ash browser tests).
BUG=179830
1st Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=201806
Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=201966
R=robertshield@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/14629025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test/test_metro_viewer_process_host.h')
-rw-r--r-- | ash/test/test_metro_viewer_process_host.h | 58 |
1 files changed, 7 insertions, 51 deletions
diff --git a/ash/test/test_metro_viewer_process_host.h b/ash/test/test_metro_viewer_process_host.h index f52230b..0f24169 100644 --- a/ash/test/test_metro_viewer_process_host.h +++ b/ash/test/test_metro_viewer_process_host.h @@ -7,69 +7,25 @@ #include <string> -#include "base/memory/scoped_ptr.h" -#include "base/synchronization/waitable_event.h" -#include "base/threading/non_thread_safe.h" -#include "base/threading/thread.h" -#include "ipc/ipc_channel_proxy.h" -#include "ipc/ipc_listener.h" -#include "ipc/ipc_sender.h" -#include "ui/gfx/native_widget_types.h" +#include "win8/viewer/metro_viewer_process_host.h" class AcceleratedSurface; namespace ash { namespace test { -class TestMetroViewerProcessHost : public IPC::Listener, - public IPC::Sender, - public base::NonThreadSafe { +class TestMetroViewerProcessHost : public win8::MetroViewerProcessHost { public: - explicit TestMetroViewerProcessHost(const std::string& ipc_channel_name); + TestMetroViewerProcessHost(const std::string& ipc_channel_name, + base::SingleThreadTaskRunner* ipc_task_runner); virtual ~TestMetroViewerProcessHost(); - // Launches the viewer process associated with the given |app_user_model_id| - // and blocks until that viewer process connects or until a timeout is - // reached. Returns true if the viewer process connects before the timeout is - // reached. - bool LaunchViewerAndWaitForConnection( - const base::string16& app_user_model_id); - - // IPC::Sender implementation: - virtual bool Send(IPC::Message* msg) OVERRIDE; - - // IPC::Listener implementation: - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnChannelError() OVERRIDE; - bool closed_unexpectedly() { return closed_unexpectedly_; } private: - void OnSetTargetSurface(gfx::NativeViewId target_surface); - - void NotifyChannelConnected(); - - // Inner message filter used to handle connection event on the IPC channel - // proxy's background thread. This prevents consumers of - // TestMetroViewerProcessHost from having to pump messages on their own - // message loop. - class InternalMessageFilter : public IPC::ChannelProxy::MessageFilter { - public: - InternalMessageFilter(TestMetroViewerProcessHost* owner); - - // IPC::ChannelProxy::MessageFilter implementation. - virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; - - private: - TestMetroViewerProcessHost* owner_; - DISALLOW_COPY_AND_ASSIGN(InternalMessageFilter); - }; - - // Members related to the IPC channel. Note that the order is important - // here as ipc_thread_ should be destroyed after channel_. - base::Thread ipc_thread_; - scoped_ptr<IPC::ChannelProxy> channel_; - base::WaitableEvent channel_connected_event_; + // win8::MetroViewerProcessHost implementation + virtual void OnChannelError() OVERRIDE; + virtual void OnSetTargetSurface(gfx::NativeViewId target_surface) OVERRIDE; scoped_ptr<AcceleratedSurface> backing_surface; |