OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 IN_PROC_BROWSER_TEST_F(BrowsingDataLocalStorageHelperTest, DeleteSingleFile) { | 119 IN_PROC_BROWSER_TEST_F(BrowsingDataLocalStorageHelperTest, DeleteSingleFile) { |
120 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper( | 120 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper( |
121 new BrowsingDataLocalStorageHelper(browser()->profile())); | 121 new BrowsingDataLocalStorageHelper(browser()->profile())); |
122 CreateLocalStorageFilesForTest(); | 122 CreateLocalStorageFilesForTest(); |
123 local_storage_helper->DeleteLocalStorageFile( | 123 local_storage_helper->DeleteLocalStorageFile( |
124 GetLocalStoragePathForTestingProfile().Append(FilePath(kTestFile0))); | 124 GetLocalStoragePathForTestingProfile().Append(FilePath(kTestFile0))); |
125 scoped_refptr<base::ThreadTestHelper> wait_for_webkit_thread( | 125 scoped_refptr<base::ThreadTestHelper> wait_for_webkit_thread( |
126 new base::ThreadTestHelper( | 126 new base::ThreadTestHelper( |
127 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT))); | 127 BrowserThread::GetMessageLoopProxyForThread( |
| 128 BrowserThread::WEBKIT_DEPRECATED))); |
128 ASSERT_TRUE(wait_for_webkit_thread->Run()); | 129 ASSERT_TRUE(wait_for_webkit_thread->Run()); |
129 // Ensure the file has been deleted. | 130 // Ensure the file has been deleted. |
130 file_util::FileEnumerator file_enumerator( | 131 file_util::FileEnumerator file_enumerator( |
131 GetLocalStoragePathForTestingProfile(), | 132 GetLocalStoragePathForTestingProfile(), |
132 false, | 133 false, |
133 file_util::FileEnumerator::FILES); | 134 file_util::FileEnumerator::FILES); |
134 int num_files = 0; | 135 int num_files = 0; |
135 for (FilePath file_path = file_enumerator.Next(); | 136 for (FilePath file_path = file_enumerator.Next(); |
136 !file_path.empty(); | 137 !file_path.empty(); |
137 file_path = file_enumerator.Next()) { | 138 file_path = file_enumerator.Next()) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 base::Unretained(&callback))); | 188 base::Unretained(&callback))); |
188 | 189 |
189 std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo> result = | 190 std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo> result = |
190 callback.result(); | 191 callback.result(); |
191 | 192 |
192 ASSERT_EQ(1u, result.size()); | 193 ASSERT_EQ(1u, result.size()); |
193 EXPECT_EQ(FilePath(file).value(), | 194 EXPECT_EQ(FilePath(file).value(), |
194 result.begin()->file_path.BaseName().value()); | 195 result.begin()->file_path.BaseName().value()); |
195 } | 196 } |
196 } // namespace | 197 } // namespace |
OLD | NEW |