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

Unified Diff: remoting/host/it2me/it2me_native_messaging_host_unittest.cc

Issue 2452223002: It2Me Host changes to better support Confirmation Dialog (Closed)
Patch Set: Reordering enum Created 4 years, 1 month 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
« no previous file with comments | « remoting/host/it2me/it2me_native_messaging_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_native_messaging_host_unittest.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
index 6c9732ce355368592e64687e4e9a7cf79b8de854..14e7ed56bb35e16622ffb4cb073634956d9d0605 100644
--- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
@@ -169,6 +169,7 @@ void MockIt2MeHost::Connect() {
access_code, lifetime));
RunSetState(kReceivedAccessCode);
+ RunSetState(kConnecting);
std::string client_username(kTestClientUsername);
host_context()->ui_task_runner()->PostTask(
@@ -401,10 +402,11 @@ void It2MeNativeMessagingHostTest::VerifyConnectResponses(int request_id) {
bool starting_received = false;
bool requestedAccessCode_received = false;
bool receivedAccessCode_received = false;
+ bool connecting_received = false;
bool connected_received = false;
- // We expect a total of 5 messages: 1 connectResponse and 4 hostStateChanged.
- for (int i = 0; i < 5; ++i) {
+ // We expect a total of 6 messages: 1 connectResponse and 5 hostStateChanged.
+ for (int i = 0; i < 6; ++i) {
std::unique_ptr<base::DictionaryValue> response =
ReadMessageFromOutputPipe();
ASSERT_TRUE(response);
@@ -441,6 +443,10 @@ void It2MeNativeMessagingHostTest::VerifyConnectResponses(int request_id) {
response->GetInteger("accessCodeLifetime", &accessCodeLifetime));
EXPECT_EQ(kTestAccessCodeLifetimeInSeconds, accessCodeLifetime);
} else if (state ==
+ It2MeNativeMessagingHost::HostStateToString(kConnecting)) {
+ EXPECT_FALSE(connecting_received);
+ connecting_received = true;
+ } else if (state ==
It2MeNativeMessagingHost::HostStateToString(kConnected)) {
EXPECT_FALSE(connected_received);
connected_received = true;
@@ -500,8 +506,9 @@ void It2MeNativeMessagingHostTest::TestBadRequest(const base::Value& message,
VerifyHelloResponse(1);
- if (expect_error_response)
+ if (expect_error_response) {
VerifyErrorResponse();
+ }
std::unique_ptr<base::DictionaryValue> response = ReadMessageFromOutputPipe();
EXPECT_FALSE(response);
@@ -606,8 +613,9 @@ TEST_F(It2MeNativeMessagingHostTest, Connect) {
// A new It2MeHost instance is created for every it2me session. The native
// messaging host, on the other hand, is long lived. This test verifies
// multiple It2Me host startup and shutdowns.
- for (int i = 0; i < 3; ++i)
+ for (int i = 0; i < 3; ++i) {
TestConnect();
+ }
}
// Verify non-Dictionary requests are rejected.
« no previous file with comments | « remoting/host/it2me/it2me_native_messaging_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698