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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.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 (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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void CreateLocalStorageFilesForTest() { 53 void CreateLocalStorageFilesForTest() {
54 // Note: This helper depends on details of how the dom_storage library 54 // Note: This helper depends on details of how the dom_storage library
55 // stores data in the host file system. 55 // stores data in the host file system.
56 base::FilePath storage_path = GetLocalStoragePathForTestingProfile(); 56 base::FilePath storage_path = GetLocalStoragePathForTestingProfile();
57 base::CreateDirectory(storage_path); 57 base::CreateDirectory(storage_path);
58 const base::FilePath::CharType* kFilesToCreate[] = { 58 const base::FilePath::CharType* kFilesToCreate[] = {
59 kTestFile0, kTestFile1, kTestFileInvalid, kTestFileExtension 59 kTestFile0, kTestFile1, kTestFileInvalid, kTestFileExtension
60 }; 60 };
61 for (size_t i = 0; i < arraysize(kFilesToCreate); ++i) { 61 for (size_t i = 0; i < arraysize(kFilesToCreate); ++i) {
62 base::FilePath file_path = storage_path.Append(kFilesToCreate[i]); 62 base::FilePath file_path = storage_path.Append(kFilesToCreate[i]);
63 file_util::WriteFile(file_path, NULL, 0); 63 base::WriteFile(file_path, NULL, 0);
64 } 64 }
65 } 65 }
66 66
67 base::FilePath GetLocalStoragePathForTestingProfile() { 67 base::FilePath GetLocalStoragePathForTestingProfile() {
68 return browser()->profile()->GetPath().AppendASCII("Local Storage"); 68 return browser()->profile()->GetPath().AppendASCII("Local Storage");
69 } 69 }
70 }; 70 };
71 71
72 // This class is notified by BrowsingDataLocalStorageHelper on the UI thread 72 // This class is notified by BrowsingDataLocalStorageHelper on the UI thread
73 // once it finishes fetching the local storage data. 73 // once it finishes fetching the local storage data.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 base::Bind(&TestCompletionCallback::callback, 182 base::Bind(&TestCompletionCallback::callback,
183 base::Unretained(&callback))); 183 base::Unretained(&callback)));
184 184
185 std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo> result = 185 std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo> result =
186 callback.result(); 186 callback.result();
187 187
188 ASSERT_EQ(1u, result.size()); 188 ASSERT_EQ(1u, result.size());
189 EXPECT_EQ(origin, result.begin()->origin_url); 189 EXPECT_EQ(origin, result.begin()->origin_url);
190 } 190 }
191 } // namespace 191 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698