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

Side by Side Diff: chrome/service/cloud_print/connector_settings_unittest.cc

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | chrome/test/automation/proxy_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 class ConnectorSettingsTest : public testing::Test { 50 class ConnectorSettingsTest : public testing::Test {
51 protected: 51 protected:
52 virtual void SetUp() OVERRIDE { 52 virtual void SetUp() OVERRIDE {
53 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 53 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
54 message_loop_proxy_ = base::MessageLoopProxy::current(); 54 message_loop_proxy_ = base::MessageLoopProxy::current();
55 } 55 }
56 56
57 ServiceProcessPrefs* CreateTestFile(const char* json) { 57 ServiceProcessPrefs* CreateTestFile(const char* json) {
58 base::FilePath file_name = temp_dir_.path().AppendASCII("file.txt"); 58 base::FilePath file_name = temp_dir_.path().AppendASCII("file.txt");
59 file_util::Delete(file_name, false); 59 base::Delete(file_name, false);
60 if (json) { 60 if (json) {
61 std::string content = json; 61 std::string content = json;
62 std::replace(content.begin(), content.end(), '\'', '"'); 62 std::replace(content.begin(), content.end(), '\'', '"');
63 file_util::WriteFile(file_name, content.c_str(), content.size()); 63 file_util::WriteFile(file_name, content.c_str(), content.size());
64 } 64 }
65 ServiceProcessPrefs* prefs = 65 ServiceProcessPrefs* prefs =
66 new ServiceProcessPrefs(file_name, message_loop_proxy_.get()); 66 new ServiceProcessPrefs(file_name, message_loop_proxy_.get());
67 prefs->ReadPrefs(); 67 prefs->ReadPrefs();
68 return prefs; 68 return prefs;
69 } 69 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 settings.SetXmppPingTimeoutSec(256); 143 settings.SetXmppPingTimeoutSec(256);
144 EXPECT_TRUE(settings.xmpp_ping_enabled()); 144 EXPECT_TRUE(settings.xmpp_ping_enabled());
145 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), 256); 145 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), 256);
146 146
147 // Set invalid settings, and check correct defaults. 147 // Set invalid settings, and check correct defaults.
148 settings.SetXmppPingTimeoutSec(1); 148 settings.SetXmppPingTimeoutSec(1);
149 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinimumXmppPingTimeoutSecs); 149 EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinimumXmppPingTimeoutSecs);
150 } 150 }
151 151
152 } // namespace cloud_print 152 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | chrome/test/automation/proxy_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698