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

Unified Diff: remoting/host/setup/native_messaging_host_unittest.cc

Issue 16236008: Send enums as strings between Chromoting Native Messaging host and web-app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move constants and fix loops Created 7 years, 7 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/setup/native_messaging_host_unittest.cc
diff --git a/remoting/host/setup/native_messaging_host_unittest.cc b/remoting/host/setup/native_messaging_host_unittest.cc
index b6fc4abf156bf62a412043e33b8fa63995dbc1bb..225c8ad8378330a56b9e019825d32f8a1e47fa8c 100644
--- a/remoting/host/setup/native_messaging_host_unittest.cc
+++ b/remoting/host/setup/native_messaging_host_unittest.cc
@@ -85,9 +85,8 @@ void VerifyStopDaemonResponse(const base::DictionaryValue* response) {
std::string value;
EXPECT_TRUE(response->GetString("type", &value));
EXPECT_EQ("stopDaemonResponse", value);
- int result;
- EXPECT_TRUE(response->GetInteger("result", &result));
- EXPECT_EQ(0, result);
+ EXPECT_TRUE(response->GetString("result", &value));
+ EXPECT_EQ(remoting::NativeMessagingHost::kResultOk, value);
Sergey Ulanov 2013/05/31 23:01:43 I'd rather not bother about sharing constants with
Lambros 2013/06/03 21:28:44 Done.
}
void VerifyGetDaemonStateResponse(const base::DictionaryValue* response) {
@@ -95,9 +94,8 @@ void VerifyGetDaemonStateResponse(const base::DictionaryValue* response) {
std::string value;
EXPECT_TRUE(response->GetString("type", &value));
EXPECT_EQ("getDaemonStateResponse", value);
- int result;
- EXPECT_TRUE(response->GetInteger("state", &result));
- EXPECT_EQ(4, result);
+ EXPECT_TRUE(response->GetString("state", &value));
+ EXPECT_EQ(remoting::NativeMessagingHost::kStateStarted, value);
}
void VerifyUpdateDaemonConfigResponse(const base::DictionaryValue* response) {
@@ -105,9 +103,8 @@ void VerifyUpdateDaemonConfigResponse(const base::DictionaryValue* response) {
std::string value;
EXPECT_TRUE(response->GetString("type", &value));
EXPECT_EQ("updateDaemonConfigResponse", value);
- int result;
- EXPECT_TRUE(response->GetInteger("result", &result));
- EXPECT_EQ(0, result);
+ EXPECT_TRUE(response->GetString("result", &value));
+ EXPECT_EQ(remoting::NativeMessagingHost::kResultOk, value);
}
void VerifyStartDaemonResponse(const base::DictionaryValue* response) {
@@ -115,9 +112,8 @@ void VerifyStartDaemonResponse(const base::DictionaryValue* response) {
std::string value;
EXPECT_TRUE(response->GetString("type", &value));
EXPECT_EQ("startDaemonResponse", value);
- int result;
- EXPECT_TRUE(response->GetInteger("result", &result));
- EXPECT_EQ(0, result);
+ EXPECT_TRUE(response->GetString("result", &value));
+ EXPECT_EQ(remoting::NativeMessagingHost::kResultOk, value);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698