OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 kMessageDisconnectTerminal = ChromotingNetworkHostMsg_DisconnectTerminal::ID, | 33 kMessageDisconnectTerminal = ChromotingNetworkHostMsg_DisconnectTerminal::ID, |
34 kMessageTerminalDisconnected = | 34 kMessageTerminalDisconnected = |
35 ChromotingDaemonNetworkMsg_TerminalDisconnected::ID | 35 ChromotingDaemonNetworkMsg_TerminalDisconnected::ID |
36 }; | 36 }; |
37 | 37 |
38 // Provides a public constructor allowing the test to create instances of | 38 // Provides a public constructor allowing the test to create instances of |
39 // DesktopSession directly. | 39 // DesktopSession directly. |
40 class FakeDesktopSession : public DesktopSession { | 40 class FakeDesktopSession : public DesktopSession { |
41 public: | 41 public: |
42 FakeDesktopSession(DaemonProcess* daemon_process, int id); | 42 FakeDesktopSession(DaemonProcess* daemon_process, int id); |
43 virtual ~FakeDesktopSession(); | 43 ~FakeDesktopSession() override; |
44 | 44 |
45 virtual void SetScreenResolution( | 45 void SetScreenResolution(const ScreenResolution& resolution) override {} |
46 const ScreenResolution& resolution) override {} | |
47 | 46 |
48 private: | 47 private: |
49 DISALLOW_COPY_AND_ASSIGN(FakeDesktopSession); | 48 DISALLOW_COPY_AND_ASSIGN(FakeDesktopSession); |
50 }; | 49 }; |
51 | 50 |
52 class MockDaemonProcess : public DaemonProcess { | 51 class MockDaemonProcess : public DaemonProcess { |
53 public: | 52 public: |
54 MockDaemonProcess( | 53 MockDaemonProcess( |
55 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 54 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
56 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 55 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 EXPECT_EQ(1u, desktop_sessions().size()); | 332 EXPECT_EQ(1u, desktop_sessions().size()); |
334 EXPECT_EQ(id, desktop_sessions().front()->id()); | 333 EXPECT_EQ(id, desktop_sessions().front()->id()); |
335 | 334 |
336 EXPECT_TRUE(daemon_process_->OnMessageReceived( | 335 EXPECT_TRUE(daemon_process_->OnMessageReceived( |
337 ChromotingNetworkHostMsg_ConnectTerminal(id, resolution, false))); | 336 ChromotingNetworkHostMsg_ConnectTerminal(id, resolution, false))); |
338 EXPECT_TRUE(desktop_sessions().empty()); | 337 EXPECT_TRUE(desktop_sessions().empty()); |
339 EXPECT_EQ(0, terminal_id_); | 338 EXPECT_EQ(0, terminal_id_); |
340 } | 339 } |
341 | 340 |
342 } // namespace remoting | 341 } // namespace remoting |
OLD | NEW |