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

Unified Diff: remoting/host/client_session_unittest.cc

Issue 12544019: Create a desktop environment instance late so that it will see the curtain_required flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased on top of https://chromiumcodereview.appspot.com/12794004/ 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
« remoting/host/client_session.cc ('K') | « remoting/host/client_session.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session_unittest.cc
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc
index 33277f58542941cdf46e0e7db1ae345b834b6bd4..c1d15d609a7f5b5adb72e09c7d95531d2f4c32da 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -29,9 +29,9 @@ using testing::AnyNumber;
using testing::DeleteArg;
using testing::DoAll;
using testing::Expectation;
-using testing::InSequence;
using testing::Return;
using testing::ReturnRef;
+using testing::Sequence;
namespace {
@@ -249,15 +249,17 @@ TEST_F(ClientSessionTest, ClipboardStubFilter) {
clipboard_event3.set_mime_type(kMimeTypeTextUtf8);
clipboard_event3.set_data("c");
- InSequence s;
+ Sequence s;
EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_));
- EXPECT_CALL(*event_executor_, StartPtr(_));
+ EXPECT_CALL(*event_executor_, StartPtr(_))
+ .InSequence(s);
EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_));
// Wait for the first video packet to be captured to make sure that
// the injected input will go though. Otherwise mouse events will be blocked
// by the mouse clamping filter.
EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _))
+ .InSequence(s)
Wez 2013/03/14 04:15:54 Aren't you effectively saying that you expect the
alexeypa (please no reviews) 2013/03/14 19:09:06 It is not guaranteed if we assume that video sched
Wez 2013/03/15 00:15:26 nit: If you instead save the OnSessionAuthenticate
alexeypa (please no reviews) 2013/03/15 00:28:02 Done.
.WillOnce(DoAll(
// This event should get through to the clipboard stub.
InjectClipboardEvent(connection_, clipboard_event2),
@@ -267,8 +269,10 @@ TEST_F(ClientSessionTest, ClipboardStubFilter) {
InjectClipboardEvent(connection_, clipboard_event3),
InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession)));
EXPECT_CALL(*event_executor_, InjectClipboardEvent(EqualsClipboardEvent(
- kMimeTypeTextUtf8, "b")));
- EXPECT_CALL(session_event_handler_, OnSessionClosed(_));
+ kMimeTypeTextUtf8, "b")))
+ .InSequence(s);
+ EXPECT_CALL(session_event_handler_, OnSessionClosed(_))
+ .InSequence(s);
// This event should not get through to the clipboard stub,
// because the client isn't authenticated yet.
@@ -320,15 +324,17 @@ TEST_F(ClientSessionTest, InputStubFilter) {
mouse_event3.set_x(300);
mouse_event3.set_y(301);
- InSequence s;
+ Sequence s;
EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_));
- EXPECT_CALL(*event_executor_, StartPtr(_));
+ EXPECT_CALL(*event_executor_, StartPtr(_))
+ .InSequence(s);
EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_));
// Wait for the first video packet to be captured to make sure that
// the injected input will go though. Otherwise mouse events will be blocked
// by the mouse clamping filter.
EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _))
+ .InSequence(s)
Wez 2013/03/14 04:15:54 See above.
.WillOnce(DoAll(
// These events should get through to the input stub.
InjectKeyEvent(connection_, key_event2_down),
@@ -340,10 +346,14 @@ TEST_F(ClientSessionTest, InputStubFilter) {
InjectKeyEvent(connection_, key_event3),
InjectMouseEvent(connection_, mouse_event3),
InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession)));
- EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, true)));
- EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, false)));
- EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseEvent(200, 201)));
- EXPECT_CALL(session_event_handler_, OnSessionClosed(_));
+ EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, true)))
+ .InSequence(s);
+ EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, false)))
+ .InSequence(s);
+ EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseEvent(200, 201)))
+ .InSequence(s);
+ EXPECT_CALL(session_event_handler_, OnSessionClosed(_))
+ .InSequence(s);
// These events should not get through to the input stub,
// because the client isn't authenticated yet.
@@ -365,15 +375,17 @@ TEST_F(ClientSessionTest, LocalInputTest) {
mouse_event3.set_x(300);
mouse_event3.set_y(301);
- InSequence s;
+ Sequence s;
EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_));
- EXPECT_CALL(*event_executor_, StartPtr(_));
+ EXPECT_CALL(*event_executor_, StartPtr(_))
+ .InSequence(s);
EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_));
// Wait for the first video packet to be captured to make sure that
// the injected input will go though. Otherwise mouse events will be blocked
// by the mouse clamping filter.
EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _))
+ .InSequence(s)
Wez 2013/03/14 04:15:54 See above.
.WillOnce(DoAll(
// This event should get through to the input stub.
InjectMouseEvent(connection_, mouse_event1),
@@ -392,9 +404,12 @@ TEST_F(ClientSessionTest, LocalInputTest) {
// eventually (via dependency injection, not sleep!)
InvokeWithoutArgs(this, &ClientSessionTest::DisconnectClientSession),
InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession)));
- EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseEvent(100, 101)));
- EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseEvent(200, 201)));
- EXPECT_CALL(session_event_handler_, OnSessionClosed(_));
+ EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseEvent(100, 101)))
+ .InSequence(s);
+ EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseEvent(200, 201)))
+ .InSequence(s);
+ EXPECT_CALL(session_event_handler_, OnSessionClosed(_))
+ .InSequence(s);
ConnectClientSession();
message_loop_.Run();
@@ -413,30 +428,39 @@ TEST_F(ClientSessionTest, RestoreEventState) {
mousedown.set_button(protocol::MouseEvent::BUTTON_LEFT);
mousedown.set_button_down(true);
- InSequence s;
+ Sequence s;
EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_));
- EXPECT_CALL(*event_executor_, StartPtr(_));
+ EXPECT_CALL(*event_executor_, StartPtr(_))
+ .InSequence(s);
EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_));
// Wait for the first video packet to be captured to make sure that
// the injected input will go though. Otherwise mouse events will be blocked
// by the mouse clamping filter.
EXPECT_CALL(video_stub_, ProcessVideoPacketPtr(_, _))
+ .InSequence(s)
Wez 2013/03/14 04:15:54 See above.
.WillOnce(DoAll(
InjectKeyEvent(connection_, key1),
InjectKeyEvent(connection_, key2),
InjectMouseEvent(connection_, mousedown),
InvokeWithoutArgs(this, &ClientSessionTest::DisconnectClientSession),
InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession)));
- EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(1, true)));
- EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, true)));
+ EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(1, true)))
+ .InSequence(s);
+ EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, true)))
+ .InSequence(s);
EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseButtonEvent(
- protocol::MouseEvent::BUTTON_LEFT, true)));
- EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(1, false)));
- EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, false)));
+ protocol::MouseEvent::BUTTON_LEFT, true)))
+ .InSequence(s);
+ EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(1, false)))
+ .InSequence(s);
+ EXPECT_CALL(*event_executor_, InjectKeyEvent(EqualsUsbEvent(2, false)))
+ .InSequence(s);
EXPECT_CALL(*event_executor_, InjectMouseEvent(EqualsMouseButtonEvent(
- protocol::MouseEvent::BUTTON_LEFT, false)));
- EXPECT_CALL(session_event_handler_, OnSessionClosed(_));
+ protocol::MouseEvent::BUTTON_LEFT, false)))
+ .InSequence(s);
+ EXPECT_CALL(session_event_handler_, OnSessionClosed(_))
+ .InSequence(s);
ConnectClientSession();
message_loop_.Run();
« remoting/host/client_session.cc ('K') | « remoting/host/client_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698