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 #include "chrome/browser/browsing_data_remover.h" | 5 #include "chrome/browser/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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 HistoryService* history_service_; | 307 HistoryService* history_service_; |
308 | 308 |
309 DISALLOW_COPY_AND_ASSIGN(RemoveHistoryTester); | 309 DISALLOW_COPY_AND_ASSIGN(RemoveHistoryTester); |
310 }; | 310 }; |
311 | 311 |
312 class RemoveLocalStorageTester : public BrowsingDataRemoverTester { | 312 class RemoveLocalStorageTester : public BrowsingDataRemoverTester { |
313 public: | 313 public: |
314 explicit RemoveLocalStorageTester(TestingProfile* profile) | 314 explicit RemoveLocalStorageTester(TestingProfile* profile) |
315 : profile_(profile), dom_storage_context_(NULL) { | 315 : profile_(profile), dom_storage_context_(NULL) { |
316 dom_storage_context_ = | 316 dom_storage_context_ = |
317 content::BrowserContext::GetDOMStorageContext(profile); | 317 content::BrowserContext::GetDefaultDOMStorageContext(profile); |
318 } | 318 } |
319 | 319 |
320 // Returns true, if the given origin URL exists. | 320 // Returns true, if the given origin URL exists. |
321 bool DOMStorageExistsForOrigin(const GURL& origin) { | 321 bool DOMStorageExistsForOrigin(const GURL& origin) { |
322 GetUsageInfo(); | 322 GetUsageInfo(); |
323 BlockUntilNotified(); | 323 BlockUntilNotified(); |
324 for (size_t i = 0; i < infos_.size(); ++i) { | 324 for (size_t i = 0; i < infos_.size(); ++i) { |
325 if (origin == infos_[i].origin) | 325 if (origin == infos_[i].origin) |
326 return true; | 326 return true; |
327 } | 327 } |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 ASSERT_TRUE(tester->HistoryContainsURL(kOrigin2)); | 1145 ASSERT_TRUE(tester->HistoryContainsURL(kOrigin2)); |
1146 | 1146 |
1147 BlockUntilOriginDataRemoved(BrowsingDataRemover::LAST_HOUR, | 1147 BlockUntilOriginDataRemoved(BrowsingDataRemover::LAST_HOUR, |
1148 BrowsingDataRemover::REMOVE_HISTORY, kOrigin2, tester.get()); | 1148 BrowsingDataRemover::REMOVE_HISTORY, kOrigin2, tester.get()); |
1149 | 1149 |
1150 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask()); | 1150 EXPECT_EQ(BrowsingDataRemover::REMOVE_HISTORY, GetRemovalMask()); |
1151 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); | 1151 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); |
1152 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin1)); | 1152 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin1)); |
1153 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin2)); | 1153 EXPECT_TRUE(tester->HistoryContainsURL(kOrigin2)); |
1154 } | 1154 } |
OLD | NEW |