OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
11 #include "remoting/host/json_host_config.h" | 11 #include "remoting/host/json_host_config.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 | 15 |
16 namespace { | 16 namespace { |
17 const char *kTestConfig = | 17 const char* kTestConfig = |
18 "{\n" | 18 "{\n" |
19 " \"xmpp_login\" : \"test@gmail.com\",\n" | 19 " \"xmpp_login\" : \"test@gmail.com\",\n" |
20 " \"xmpp_auth_token\" : \"TEST_AUTH_TOKEN\",\n" | 20 " \"xmpp_auth_token\" : \"TEST_AUTH_TOKEN\",\n" |
21 " \"host_id\" : \"TEST_HOST_ID\",\n" | 21 " \"host_id\" : \"TEST_HOST_ID\",\n" |
22 " \"host_name\" : \"TEST_MACHINE_NAME\",\n" | 22 " \"host_name\" : \"TEST_MACHINE_NAME\",\n" |
23 " \"private_key\" : \"TEST_PRIVATE_KEY\"\n" | 23 " \"private_key\" : \"TEST_PRIVATE_KEY\"\n" |
24 "}\n"; | 24 "}\n"; |
25 | 25 |
26 // Helper for Update test. | 26 // Helper for Update test. |
27 class TestConfigUpdater : public base::RefCountedThreadSafe<TestConfigUpdater> { | 27 class TestConfigUpdater : public base::RefCountedThreadSafe<TestConfigUpdater> { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 EXPECT_EQ(new_auth_token_value, value); | 112 EXPECT_EQ(new_auth_token_value, value); |
113 EXPECT_TRUE(reader->GetString(kHostIdConfigPath, &value)); | 113 EXPECT_TRUE(reader->GetString(kHostIdConfigPath, &value)); |
114 EXPECT_EQ("TEST_HOST_ID", value); | 114 EXPECT_EQ("TEST_HOST_ID", value); |
115 EXPECT_TRUE(reader->GetString(kHostNameConfigPath, &value)); | 115 EXPECT_TRUE(reader->GetString(kHostNameConfigPath, &value)); |
116 EXPECT_EQ("TEST_MACHINE_NAME", value); | 116 EXPECT_EQ("TEST_MACHINE_NAME", value); |
117 EXPECT_TRUE(reader->GetString(kPrivateKeyConfigPath, &value)); | 117 EXPECT_TRUE(reader->GetString(kPrivateKeyConfigPath, &value)); |
118 EXPECT_EQ("TEST_PRIVATE_KEY", value); | 118 EXPECT_EQ("TEST_PRIVATE_KEY", value); |
119 } | 119 } |
120 | 120 |
121 } | 121 } |
OLD | NEW |