OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/service/cloud_print/connector_settings.h" | 5 #include "chrome/service/cloud_print/connector_settings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/service/cloud_print/cloud_print_consts.h" | 14 #include "chrome/common/cloud_print/cloud_print_constants.h" |
15 #include "chrome/service/service_process_prefs.h" | 15 #include "chrome/service/service_process_prefs.h" |
16 | 16 |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
| 20 namespace cloud_print { |
| 21 |
20 const char kServiceStateContent[] = | 22 const char kServiceStateContent[] = |
21 "{" | 23 "{" |
22 " 'cloud_print': {" | 24 " 'cloud_print': {" |
23 " 'auth_token': 'token'," | 25 " 'auth_token': 'token'," |
24 " 'email': 'user@gmail.com'," | 26 " 'email': 'user@gmail.com'," |
25 " 'enabled': true," | 27 " 'enabled': true," |
26 " 'proxy_id': 'PROXY'," | 28 " 'proxy_id': 'PROXY'," |
27 " 'robot_email': '123@cloudprint.googleusercontent.com'," | 29 " 'robot_email': '123@cloudprint.googleusercontent.com'," |
28 " 'robot_refresh_token': '123'," | 30 " 'robot_refresh_token': '123'," |
29 " 'service_url': 'http://cp.google.com'," | 31 " 'service_url': 'http://cp.google.com'," |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // Set and check valid settings. | 138 // Set and check valid settings. |
137 settings.set_xmpp_ping_enabled(true); | 139 settings.set_xmpp_ping_enabled(true); |
138 settings.SetXmppPingTimeoutSec(256); | 140 settings.SetXmppPingTimeoutSec(256); |
139 EXPECT_TRUE(settings.xmpp_ping_enabled()); | 141 EXPECT_TRUE(settings.xmpp_ping_enabled()); |
140 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), 256); | 142 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), 256); |
141 | 143 |
142 // Set invalid settings, and check correct defaults. | 144 // Set invalid settings, and check correct defaults. |
143 settings.SetXmppPingTimeoutSec(1); | 145 settings.SetXmppPingTimeoutSec(1); |
144 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinimumXmppPingTimeoutSecs); | 146 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinimumXmppPingTimeoutSecs); |
145 } | 147 } |
| 148 |
| 149 } // namespace cloud_print |
OLD | NEW |