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/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 " }," | 41 " }," |
42 " 'print_system_settings': {" | 42 " 'print_system_settings': {" |
43 " 'delete_on_enum_fail' : true" | 43 " 'delete_on_enum_fail' : true" |
44 " }" | 44 " }" |
45 " }" | 45 " }" |
46 "}"; | 46 "}"; |
47 | 47 |
48 | 48 |
49 class ConnectorSettingsTest : public testing::Test { | 49 class ConnectorSettingsTest : public testing::Test { |
50 protected: | 50 protected: |
51 virtual void SetUp() OVERRIDE { | 51 virtual void SetUp() override { |
52 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 52 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
53 message_loop_proxy_ = base::MessageLoopProxy::current(); | 53 message_loop_proxy_ = base::MessageLoopProxy::current(); |
54 } | 54 } |
55 | 55 |
56 ServiceProcessPrefs* CreateTestFile(const char* json) { | 56 ServiceProcessPrefs* CreateTestFile(const char* json) { |
57 base::FilePath file_name = temp_dir_.path().AppendASCII("file.txt"); | 57 base::FilePath file_name = temp_dir_.path().AppendASCII("file.txt"); |
58 base::DeleteFile(file_name, false); | 58 base::DeleteFile(file_name, false); |
59 if (json) { | 59 if (json) { |
60 std::string content = json; | 60 std::string content = json; |
61 std::replace(content.begin(), content.end(), '\'', '"'); | 61 std::replace(content.begin(), content.end(), '\'', '"'); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 settings.SetXmppPingTimeoutSec(256); | 142 settings.SetXmppPingTimeoutSec(256); |
143 EXPECT_TRUE(settings.xmpp_ping_enabled()); | 143 EXPECT_TRUE(settings.xmpp_ping_enabled()); |
144 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), 256); | 144 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), 256); |
145 | 145 |
146 // Set invalid settings, and check correct defaults. | 146 // Set invalid settings, and check correct defaults. |
147 settings.SetXmppPingTimeoutSec(1); | 147 settings.SetXmppPingTimeoutSec(1); |
148 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinXmppPingTimeoutSecs); | 148 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinXmppPingTimeoutSecs); |
149 } | 149 } |
150 | 150 |
151 } // namespace cloud_print | 151 } // namespace cloud_print |
OLD | NEW |