| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 bool cookies; | 385 bool cookies; |
| 386 bool storage; | 386 bool storage; |
| 387 bool cache; | 387 bool cache; |
| 388 int mask; | 388 int mask; |
| 389 } test_cases[] = { | 389 } test_cases[] = { |
| 390 {false, false, false, 0}, | 390 {false, false, false, 0}, |
| 391 {true, false, false, | 391 {true, false, false, |
| 392 BrowsingDataRemover::DATA_TYPE_COOKIES | | 392 BrowsingDataRemover::DATA_TYPE_COOKIES | |
| 393 BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | | 393 BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | |
| 394 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA}, | 394 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA}, |
| 395 {false, true, false, | 395 {false, true, false, BrowsingDataRemover::DATA_TYPE_DOM_STORAGE}, |
| 396 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_SITE_DATA & | |
| 397 ~BrowsingDataRemover::DATA_TYPE_COOKIES & | |
| 398 ~BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS & | |
| 399 ~ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA}, | |
| 400 {false, false, true, BrowsingDataRemover::DATA_TYPE_CACHE}, | 396 {false, false, true, BrowsingDataRemover::DATA_TYPE_CACHE}, |
| 401 {true, true, false, | 397 {true, true, false, |
| 402 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_SITE_DATA}, | 398 BrowsingDataRemover::DATA_TYPE_COOKIES | |
| 399 BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | |
| 400 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA | |
| 401 BrowsingDataRemover::DATA_TYPE_DOM_STORAGE}, |
| 403 {true, false, true, | 402 {true, false, true, |
| 404 BrowsingDataRemover::DATA_TYPE_COOKIES | | 403 BrowsingDataRemover::DATA_TYPE_COOKIES | |
| 405 BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | | 404 BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | |
| 406 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA | | 405 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA | |
| 407 BrowsingDataRemover::DATA_TYPE_CACHE}, | 406 BrowsingDataRemover::DATA_TYPE_CACHE}, |
| 408 {false, true, true, | 407 {false, true, true, |
| 409 BrowsingDataRemover::DATA_TYPE_CACHE | | 408 BrowsingDataRemover::DATA_TYPE_DOM_STORAGE | |
| 410 (ChromeBrowsingDataRemoverDelegate::DATA_TYPE_SITE_DATA & | 409 BrowsingDataRemover::DATA_TYPE_CACHE}, |
| 411 ~BrowsingDataRemover::DATA_TYPE_COOKIES & | |
| 412 ~BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS & | |
| 413 ~ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA)}, | |
| 414 {true, true, true, | 410 {true, true, true, |
| 415 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_SITE_DATA | | 411 BrowsingDataRemover::DATA_TYPE_COOKIES | |
| 412 BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | |
| 413 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA | |
| 414 BrowsingDataRemover::DATA_TYPE_DOM_STORAGE | |
| 416 BrowsingDataRemover::DATA_TYPE_CACHE}, | 415 BrowsingDataRemover::DATA_TYPE_CACHE}, |
| 417 }; | 416 }; |
| 418 | 417 |
| 419 for (unsigned int i = 0; i < arraysize(test_cases); ++i) { | 418 for (unsigned int i = 0; i < arraysize(test_cases); ++i) { |
| 420 SCOPED_TRACE(base::StringPrintf("Test case %d", i)); | 419 SCOPED_TRACE(base::StringPrintf("Test case %d", i)); |
| 421 const TestCase& test_case = test_cases[i]; | 420 const TestCase& test_case = test_cases[i]; |
| 422 | 421 |
| 423 // We always delete data for all time and all origin types. | 422 // We always delete data for all time and all origin types. |
| 424 int all_origin_types = ChromeBrowsingDataRemoverDelegate::ALL_ORIGIN_TYPES; | 423 int all_origin_types = ChromeBrowsingDataRemoverDelegate::ALL_ORIGIN_TYPES; |
| 425 | 424 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 client.ClearSiteData( | 581 client.ClearSiteData( |
| 583 profile(), origin, true /* cookies */, false /* storage */, | 582 profile(), origin, true /* cookies */, false /* storage */, |
| 584 true /* cache */, | 583 true /* cache */, |
| 585 base::Bind( | 584 base::Bind( |
| 586 &ChromeContentBrowserClientClearSiteDataTest::SetClearingFinished, | 585 &ChromeContentBrowserClientClearSiteDataTest::SetClearingFinished, |
| 587 base::Unretained(this), true)); | 586 base::Unretained(this), true)); |
| 588 EXPECT_TRUE(IsClearingFinished()); | 587 EXPECT_TRUE(IsClearingFinished()); |
| 589 } | 588 } |
| 590 | 589 |
| 591 } // namespace | 590 } // namespace |
| OLD | NEW |