Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: remoting/host/local_input_monitor_unittest.cc

Issue 12594009: Converted LocalInputMonitor into a SessionController instance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/local_input_monitor_unittest.cc
diff --git a/remoting/host/local_input_monitor_unittest.cc b/remoting/host/local_input_monitor_unittest.cc
index a3c18361b17baeb0374d638e9880050297f39735..da044511651da7ce9f3b2a6daba82c0e5ee87e3c 100644
--- a/remoting/host/local_input_monitor_unittest.cc
+++ b/remoting/host/local_input_monitor_unittest.cc
@@ -8,7 +8,6 @@
#include "base/run_loop.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/local_input_monitor.h"
-#include "remoting/host/mouse_move_observer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkPoint.h"
@@ -26,14 +25,14 @@ const MessageLoop::Type kDesiredMessageLoopType = MessageLoop::TYPE_UI;
const MessageLoop::Type kDesiredMessageLoopType = MessageLoop::TYPE_IO;
#endif // !defined(OS_WIN)
-class FakeMouseMoveObserver : public MouseMoveObserver {
+class FakeDelegate : public SessionController::Delegate {
public:
- FakeMouseMoveObserver() {}
- virtual ~FakeMouseMoveObserver() {}
+ FakeDelegate() {}
+ virtual ~FakeDelegate() {}
- // Ignore mouse events to avoid breaking the test of someone moves the mouse.
- virtual void OnLocalMouseMoved(const SkIPoint&) OVERRIDE {}
- void OnDisconnectCallback() {}
+ // Ignore all callbacks.
+ virtual void DisconnectSession() OVERRIDE {}
+ virtual void OnLocalMouseMoved(const SkIPoint& position) OVERRIDE {}
};
} // namespace
@@ -53,7 +52,7 @@ class LocalInputMonitorTest : public testing::Test {
base::RunLoop run_loop_;
scoped_refptr<AutoThreadTaskRunner> task_runner_;
- FakeMouseMoveObserver mouse_move_observer_;
+ FakeDelegate fake_delegate_;
};
// This test is really to exercise only the creation and destruction code in
@@ -61,14 +60,9 @@ class LocalInputMonitorTest : public testing::Test {
TEST_F(LocalInputMonitorTest, Basic) {
{
scoped_ptr<LocalInputMonitor> local_input_monitor =
- LocalInputMonitor::Create(task_runner_, task_runner_, task_runner_);
+ LocalInputMonitor::Create(task_runner_, task_runner_, task_runner_,
+ &fake_delegate_);
task_runner_ = NULL;
-
- local_input_monitor->Start(
- &mouse_move_observer_,
- base::Bind(&FakeMouseMoveObserver::OnDisconnectCallback,
- base::Unretained(&mouse_move_observer_)));
- local_input_monitor->Stop();
}
run_loop_.Run();

Powered by Google App Engine
This is Rietveld 408576698