| OLD | NEW |
| 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 return true; | 195 return true; |
| 196 } | 196 } |
| 197 return false; | 197 return false; |
| 198 } | 198 } |
| 199 | 199 |
| 200 void AddDOMStorageTestData() { | 200 void AddDOMStorageTestData() { |
| 201 // Note: This test depends on details of how the dom_storage library | 201 // Note: This test depends on details of how the dom_storage library |
| 202 // stores data in the host file system. | 202 // stores data in the host file system. |
| 203 base::FilePath storage_path = | 203 base::FilePath storage_path = |
| 204 profile_->GetPath().AppendASCII("Local Storage"); | 204 profile_->GetPath().AppendASCII("Local Storage"); |
| 205 file_util::CreateDirectory(storage_path); | 205 base::CreateDirectory(storage_path); |
| 206 | 206 |
| 207 // Write some files. | 207 // Write some files. |
| 208 file_util::WriteFile(storage_path.Append(kDomStorageOrigin1), NULL, 0); | 208 file_util::WriteFile(storage_path.Append(kDomStorageOrigin1), NULL, 0); |
| 209 file_util::WriteFile(storage_path.Append(kDomStorageOrigin2), NULL, 0); | 209 file_util::WriteFile(storage_path.Append(kDomStorageOrigin2), NULL, 0); |
| 210 file_util::WriteFile(storage_path.Append(kDomStorageOrigin3), NULL, 0); | 210 file_util::WriteFile(storage_path.Append(kDomStorageOrigin3), NULL, 0); |
| 211 | 211 |
| 212 // Tweak their dates. | 212 // Tweak their dates. |
| 213 file_util::SetLastModifiedTime(storage_path.Append(kDomStorageOrigin1), | 213 file_util::SetLastModifiedTime(storage_path.Append(kDomStorageOrigin1), |
| 214 base::Time::Now()); | 214 base::Time::Now()); |
| 215 file_util::SetLastModifiedTime(storage_path.Append(kDomStorageOrigin2), | 215 file_util::SetLastModifiedTime(storage_path.Append(kDomStorageOrigin2), |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 clear_cb.callback())); | 956 clear_cb.callback())); |
| 957 clear_cb.WaitForResult(); | 957 clear_cb.WaitForResult(); |
| 958 | 958 |
| 959 // kOrigin1 and kOrigin2 do not have age more than a week. | 959 // kOrigin1 and kOrigin2 do not have age more than a week. |
| 960 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin1)); | 960 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin1)); |
| 961 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin2)); | 961 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin2)); |
| 962 EXPECT_TRUE(tester.DOMStorageExistsForOrigin(kOrigin3)); | 962 EXPECT_TRUE(tester.DOMStorageExistsForOrigin(kOrigin3)); |
| 963 } | 963 } |
| 964 | 964 |
| 965 } // namespace content | 965 } // namespace content |
| OLD | NEW |