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

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

Issue 2403713002: Add suborigin logic to url::Origin (Closed)
Patch Set: Fix unit test Created 4 years, 2 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 b426ff43816745e5b5fdf51de9e570a890010f65..d5043e0cc7de42fd19653c593597e00e41fcbf4a 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
@@ -52,15 +52,23 @@ TEST_F(CannedBrowsingDataLocalStorageTest, Delete) {
// Local storage for a suborigin
// (https://www.chromestatus.com/feature/5569465034997760) should be deleted
// when the corresponding physical origin is deleted.
- const GURL suborigin("http-so://suborigin.foo.example.com");
- helper->AddLocalStorage(suborigin);
+ const GURL suborigin_on_origin_3("http-so://suborigin.foo.example.com");
+ helper->AddLocalStorage(suborigin_on_origin_3);
EXPECT_EQ(2u, helper->GetLocalStorageCount());
helper->DeleteOrigin(origin3);
EXPECT_EQ(0u, helper->GetLocalStorageCount());
- helper->AddLocalStorage(suborigin);
+ helper->AddLocalStorage(suborigin_on_origin_3);
EXPECT_EQ(1u, helper->GetLocalStorageCount());
helper->DeleteOrigin(origin3);
EXPECT_EQ(0u, helper->GetLocalStorageCount());
+
+ // Similarly, the suborigin should be deleted when the corresponding
+ // physical origin is deleted.
+ helper->AddLocalStorage(origin3);
+ helper->AddLocalStorage(suborigin_on_origin_3);
+ EXPECT_EQ(2u, helper->GetLocalStorageCount());
+ helper->DeleteOrigin(suborigin_on_origin_3);
+ EXPECT_EQ(0u, helper->GetLocalStorageCount());
}
TEST_F(CannedBrowsingDataLocalStorageTest, IgnoreExtensionsAndDevTools) {
« 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