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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_unittest.cc

Issue 10837230: Move StoragePartition into content/public and remove BrowserContext::GetDOMStorageContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style fixes. Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 HistoryService* history_service_; 309 HistoryService* history_service_;
310 310
311 DISALLOW_COPY_AND_ASSIGN(RemoveHistoryTester); 311 DISALLOW_COPY_AND_ASSIGN(RemoveHistoryTester);
312 }; 312 };
313 313
314 class RemoveLocalStorageTester : public BrowsingDataRemoverTester { 314 class RemoveLocalStorageTester : public BrowsingDataRemoverTester {
315 public: 315 public:
316 explicit RemoveLocalStorageTester(TestingProfile* profile) 316 explicit RemoveLocalStorageTester(TestingProfile* profile)
317 : profile_(profile), dom_storage_context_(NULL) { 317 : profile_(profile), dom_storage_context_(NULL) {
318 dom_storage_context_ = 318 dom_storage_context_ =
319 content::BrowserContext::GetDefaultDOMStorageContext(profile); 319 content::BrowserContext::GetDefaultStoragePartition(profile)->
320 GetDOMStorageContext();
320 } 321 }
321 322
322 // Returns true, if the given origin URL exists. 323 // Returns true, if the given origin URL exists.
323 bool DOMStorageExistsForOrigin(const GURL& origin) { 324 bool DOMStorageExistsForOrigin(const GURL& origin) {
324 GetUsageInfo(); 325 GetUsageInfo();
325 BlockUntilNotified(); 326 BlockUntilNotified();
326 for (size_t i = 0; i < infos_.size(); ++i) { 327 for (size_t i = 0; i < infos_.size(); ++i) {
327 if (origin == infos_[i].origin) 328 if (origin == infos_[i].origin)
328 return true; 329 return true;
329 } 330 }
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 ASSERT_TRUE(tester->HistoryContainsURL(kOrigin2)); 1148 ASSERT_TRUE(tester->HistoryContainsURL(kOrigin2));
1148 1149
1149 BlockUntilOriginDataRemoved(BrowsingDataRemover::LAST_HOUR, 1150 BlockUntilOriginDataRemoved(BrowsingDataRemover::LAST_HOUR,
1150 BrowsingDataRemover::REMOVE_HISTORY, kOrigin2, tester.get()); 1151 BrowsingDataRemover::REMOVE_HISTORY, kOrigin2, tester.get());
1151 1152
1152 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask()); 1153 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask());
1153 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); 1154 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask());
1154 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin1)); 1155 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin1));
1155 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin2)); 1156 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin2));
1156 } 1157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698