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

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: 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..3298b72d3ea2be55b6811e0ef8f4891b9c39b138 100644
--- a/remoting/host/setup/native_messaging_host_unittest.cc
+++ b/remoting/host/setup/native_messaging_host_unittest.cc
@@ -15,6 +15,7 @@
#include "net/base/file_stream.h"
#include "net/base/net_util.h"
#include "remoting/host/pin_hash.h"
+#include "remoting/host/setup/daemon_controller.h"
#include "remoting/host/setup/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -85,9 +86,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::DaemonController::kResultOk, value);
}
void VerifyGetDaemonStateResponse(const base::DictionaryValue* response) {
@@ -95,9 +95,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::DaemonController::kStateStarted, value);
}
void VerifyUpdateDaemonConfigResponse(const base::DictionaryValue* response) {
@@ -105,9 +104,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::DaemonController::kResultOk, value);
}
void VerifyStartDaemonResponse(const base::DictionaryValue* response) {
@@ -115,9 +113,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::DaemonController::kResultOk, value);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698