| OLD | NEW |
| 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 | 5 |
| 6 #include "webkit/browser/dom_storage/session_storage_database.h" | 6 #include "webkit/browser/dom_storage/session_storage_database.h" |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 SessionStorageDatabaseTest::SessionStorageDatabaseTest() | 83 SessionStorageDatabaseTest::SessionStorageDatabaseTest() |
| 84 : kOrigin1("http://www.origin1.com"), | 84 : kOrigin1("http://www.origin1.com"), |
| 85 kOrigin2("http://www.origin2.com"), | 85 kOrigin2("http://www.origin2.com"), |
| 86 kNamespace1("namespace1"), | 86 kNamespace1("namespace1"), |
| 87 kNamespace2("namespace2"), | 87 kNamespace2("namespace2"), |
| 88 kNamespaceClone("wascloned"), | 88 kNamespaceClone("wascloned"), |
| 89 kKey1(ASCIIToUTF16("key1")), | 89 kKey1(ASCIIToUTF16("key1")), |
| 90 kKey2(ASCIIToUTF16("key2")), | 90 kKey2(ASCIIToUTF16("key2")), |
| 91 kKey3(ASCIIToUTF16("key3")), | 91 kKey3(ASCIIToUTF16("key3")), |
| 92 kValue1(base::NullableString16(ASCIIToUTF16("value1"), false)), | 92 kValue1(ASCIIToUTF16("value1"), false), |
| 93 kValue2(base::NullableString16(ASCIIToUTF16("value2"), false)), | 93 kValue2(ASCIIToUTF16("value2"), false), |
| 94 kValue3(base::NullableString16(ASCIIToUTF16("value3"), false)), | 94 kValue3(ASCIIToUTF16("value3"), false), |
| 95 kValue4(base::NullableString16(ASCIIToUTF16("value4"), false)), | 95 kValue4(ASCIIToUTF16("value4"), false) { } |
| 96 kValueNull(base::NullableString16(true)) { } | |
| 97 | 96 |
| 98 SessionStorageDatabaseTest::~SessionStorageDatabaseTest() { } | 97 SessionStorageDatabaseTest::~SessionStorageDatabaseTest() { } |
| 99 | 98 |
| 100 void SessionStorageDatabaseTest::SetUp() { | 99 void SessionStorageDatabaseTest::SetUp() { |
| 101 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 100 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 102 ResetDatabase(); | 101 ResetDatabase(); |
| 103 } | 102 } |
| 104 | 103 |
| 105 void SessionStorageDatabaseTest::ResetDatabase() { | 104 void SessionStorageDatabaseTest::ResetDatabase() { |
| 106 db_ = new SessionStorageDatabase(temp_dir_.path()); | 105 db_ = new SessionStorageDatabase(temp_dir_.path()); |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 ASSERT_TRUE(db_->CommitAreaChanges(kNamespace1, kOrigin2, false, data2)); | 788 ASSERT_TRUE(db_->CommitAreaChanges(kNamespace1, kOrigin2, false, data2)); |
| 790 | 789 |
| 791 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin1)); | 790 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin1)); |
| 792 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin2)); | 791 EXPECT_TRUE(db_->DeleteArea(kNamespace1, kOrigin2)); |
| 793 // Check that also the namespace start key was deleted. | 792 // Check that also the namespace start key was deleted. |
| 794 CheckDatabaseConsistency(); | 793 CheckDatabaseConsistency(); |
| 795 } | 794 } |
| 796 | 795 |
| 797 | 796 |
| 798 } // namespace dom_storage | 797 } // namespace dom_storage |
| OLD | NEW |