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

Unified Diff: chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc

Issue 124183002: Implement delete methods for the various CannedBrowsingDataHelpers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc
diff --git a/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc
index e9739e1c32167422c0404812774ecdb47a825213..75007961ec997d8bf191b92319537dfa807e84a6 100644
--- a/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc
@@ -29,6 +29,27 @@ TEST_F(CannedBrowsingDataLocalStorageTest, Empty) {
ASSERT_TRUE(helper->empty());
}
+TEST_F(CannedBrowsingDataLocalStorageTest, Delete) {
+ TestingProfile profile;
+
+ const GURL origin1("http://host1:9000");
+ const GURL origin2("http://example.com");
+ const GURL origin3("http://foo.example.com");
+
+ scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper(
+ new CannedBrowsingDataLocalStorageHelper(&profile));
+
+ EXPECT_TRUE(helper->empty());
+ helper->AddLocalStorage(origin1);
+ helper->AddLocalStorage(origin2);
+ helper->AddLocalStorage(origin3);
+ EXPECT_EQ(3u, helper->GetLocalStorageCount());
+ helper->DeleteOrigin(origin2);
+ EXPECT_EQ(2u, helper->GetLocalStorageCount());
+ helper->DeleteOrigin(origin1);
+ EXPECT_EQ(1u, helper->GetLocalStorageCount());
+}
+
TEST_F(CannedBrowsingDataLocalStorageTest, IgnoreExtensionsAndDevTools) {
TestingProfile profile;
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_local_storage_helper.cc ('k') | chrome/browser/browsing_data/cookies_tree_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698