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

Side by Side Diff: chrome/browser/ui/app_list/search/history_data_store_unittest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void Load() { 65 void Load() {
66 store_->Load(base::Bind(&HistoryDataStoreTest::OnRead, 66 store_->Load(base::Bind(&HistoryDataStoreTest::OnRead,
67 base::Unretained(this))); 67 base::Unretained(this)));
68 run_loop_.reset(new base::RunLoop); 68 run_loop_.reset(new base::RunLoop);
69 run_loop_->Run(); 69 run_loop_->Run();
70 run_loop_.reset(); 70 run_loop_.reset();
71 } 71 }
72 72
73 void WriteDataFile(const std::string& file_name, 73 void WriteDataFile(const std::string& file_name,
74 const std::string& data) { 74 const std::string& data) {
75 file_util::WriteFile( 75 base::WriteFile(
76 temp_dir_.path().AppendASCII(file_name), data.c_str(), data.size()); 76 temp_dir_.path().AppendASCII(file_name), data.c_str(), data.size());
77 } 77 }
78 78
79 HistoryDataStore* store() { return store_.get(); } 79 HistoryDataStore* store() { return store_.get(); }
80 const HistoryData::Associations& associations() const { 80 const HistoryData::Associations& associations() const {
81 return associations_; 81 return associations_;
82 } 82 }
83 83
84 private: 84 private:
85 void OnRead(scoped_ptr<HistoryData::Associations> associations) { 85 void OnRead(scoped_ptr<HistoryData::Associations> associations) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 EXPECT_EQ(now, it->second.update_time); 171 EXPECT_EQ(now, it->second.update_time);
172 172
173 store()->Delete(kQuery); 173 store()->Delete(kQuery);
174 Flush(); 174 Flush();
175 Load(); 175 Load();
176 EXPECT_TRUE(associations().empty()); 176 EXPECT_TRUE(associations().empty());
177 } 177 }
178 178
179 } // namespace test 179 } // namespace test
180 } // namespace app_list 180 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/task_profiler/task_profiler_data_serializer.cc ('k') | chrome/browser/ui/ash/screenshot_taker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698