| 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 | 5 |
| 6 #include "content/browser/dom_storage/session_storage_database.h" | 6 #include "content/browser/dom_storage/session_storage_database.h" |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 kValue4(base::ASCIIToUTF16("value4"), false) { } | 99 kValue4(base::ASCIIToUTF16("value4"), false) { } |
| 100 | 100 |
| 101 SessionStorageDatabaseTest::~SessionStorageDatabaseTest() { } | 101 SessionStorageDatabaseTest::~SessionStorageDatabaseTest() { } |
| 102 | 102 |
| 103 void SessionStorageDatabaseTest::SetUp() { | 103 void SessionStorageDatabaseTest::SetUp() { |
| 104 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 104 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 105 ResetDatabase(); | 105 ResetDatabase(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void SessionStorageDatabaseTest::ResetDatabase() { | 108 void SessionStorageDatabaseTest::ResetDatabase() { |
| 109 db_ = new SessionStorageDatabase(temp_dir_.path()); | 109 db_ = new SessionStorageDatabase(temp_dir_.GetPath()); |
| 110 ASSERT_TRUE(db_->LazyOpen(true)); | 110 ASSERT_TRUE(db_->LazyOpen(true)); |
| 111 } | 111 } |
| 112 | 112 |
| 113 // static | 113 // static |
| 114 bool SessionStorageDatabaseTest::IsNamespaceKey(const std::string& key, | 114 bool SessionStorageDatabaseTest::IsNamespaceKey(const std::string& key, |
| 115 std::string* namespace_id) { | 115 std::string* namespace_id) { |
| 116 std::string namespace_prefix = SessionStorageDatabase::NamespacePrefix(); | 116 std::string namespace_prefix = SessionStorageDatabase::NamespacePrefix(); |
| 117 if (!base::StartsWith(key, namespace_prefix, base::CompareCase::SENSITIVE)) | 117 if (!base::StartsWith(key, namespace_prefix, base::CompareCase::SENSITIVE)) |
| 118 return false; | 118 return false; |
| 119 if (key == namespace_prefix) | 119 if (key == namespace_prefix) |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 ASSERT_TRUE(db_->CommitAreaChanges(kNamespace1, kOrigin2, false, data2)); | 793 ASSERT_TRUE(db_->CommitAreaChanges(kNamespace1, kOrigin2, false, data2)); |
| 794 | 794 |
| 795 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin1)); | 795 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin1)); |
| 796 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin2)); | 796 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin2)); |
| 797 // Check that also the namespace start key was deleted. | 797 // Check that also the namespace start key was deleted. |
| 798 CheckDatabaseConsistency(); | 798 CheckDatabaseConsistency(); |
| 799 } | 799 } |
| 800 | 800 |
| 801 | 801 |
| 802 } // namespace content | 802 } // namespace content |
| OLD | NEW |