| 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/extensions/api/browsingdata/browsing_data_api.h" | 5 #include "chrome/browser/extensions/api/browsingdata/browsing_data_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/browsing_data_remover.h" | 14 #include "chrome/browser/browsing_data_remover.h" |
| 15 #include "chrome/browser/extensions/extension_function_test_utils.h" | 15 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
| 19 #include "chrome/test/base/in_process_browser_test.h" | 19 #include "chrome/test/base/in_process_browser_test.h" |
| 20 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
| 21 | 21 |
| 22 using namespace extension_function_test_utils; | 22 using namespace extension_function_test_utils; |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 const char kRemoveEverythingArguments[] = "[{\"since\": 1000}, {" | 26 const char kRemoveEverythingArguments[] = "[{\"since\": 1000}, {" |
| 27 "\"appcache\": true, \"cache\": true, \"cookies\": true, " | 27 "\"appcache\": true, \"cache\": true, \"cookies\": true, " |
| 28 "\"downloads\": true, \"fileSystems\": true, \"formData\": true, " | 28 "\"downloads\": true, \"fileSystems\": true, \"formData\": true, " |
| 29 "\"history\": true, \"indexedDB\": true, \"localStorage\": true, " | 29 "\"history\": true, \"indexedDB\": true, \"localStorage\": true, " |
| 30 "\"originBoundCerts\": true, \"passwords\": true, \"pluginData\": true, " | 30 "\"domainBoundCerts\": true, \"passwords\": true, \"pluginData\": true, " |
| 31 "\"webSQL\": true" | 31 "\"webSQL\": true" |
| 32 "}]"; | 32 "}]"; |
| 33 | 33 |
| 34 class ExtensionBrowsingDataTest : public InProcessBrowserTest, | 34 class ExtensionBrowsingDataTest : public InProcessBrowserTest, |
| 35 public content::NotificationObserver { | 35 public content::NotificationObserver { |
| 36 public: | 36 public: |
| 37 base::Time GetBeginTime() { | 37 base::Time GetBeginTime() { |
| 38 return called_with_details_->removal_begin; | 38 return called_with_details_->removal_begin; |
| 39 } | 39 } |
| 40 | 40 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 "fileSystems", BrowsingDataRemover::REMOVE_FILE_SYSTEMS); | 123 "fileSystems", BrowsingDataRemover::REMOVE_FILE_SYSTEMS); |
| 124 RunRemoveBrowsingDataFunctionAndCompareMask( | 124 RunRemoveBrowsingDataFunctionAndCompareMask( |
| 125 "formData", BrowsingDataRemover::REMOVE_FORM_DATA); | 125 "formData", BrowsingDataRemover::REMOVE_FORM_DATA); |
| 126 RunRemoveBrowsingDataFunctionAndCompareMask( | 126 RunRemoveBrowsingDataFunctionAndCompareMask( |
| 127 "history", BrowsingDataRemover::REMOVE_HISTORY); | 127 "history", BrowsingDataRemover::REMOVE_HISTORY); |
| 128 RunRemoveBrowsingDataFunctionAndCompareMask( | 128 RunRemoveBrowsingDataFunctionAndCompareMask( |
| 129 "indexedDB", BrowsingDataRemover::REMOVE_INDEXEDDB); | 129 "indexedDB", BrowsingDataRemover::REMOVE_INDEXEDDB); |
| 130 RunRemoveBrowsingDataFunctionAndCompareMask( | 130 RunRemoveBrowsingDataFunctionAndCompareMask( |
| 131 "localStorage", BrowsingDataRemover::REMOVE_LOCAL_STORAGE); | 131 "localStorage", BrowsingDataRemover::REMOVE_LOCAL_STORAGE); |
| 132 RunRemoveBrowsingDataFunctionAndCompareMask( | 132 RunRemoveBrowsingDataFunctionAndCompareMask( |
| 133 "originBoundCerts", BrowsingDataRemover::REMOVE_ORIGIN_BOUND_CERTS); | 133 "domainBoundCerts", BrowsingDataRemover::REMOVE_DOMAIN_BOUND_CERTS); |
| 134 RunRemoveBrowsingDataFunctionAndCompareMask( | 134 RunRemoveBrowsingDataFunctionAndCompareMask( |
| 135 "passwords", BrowsingDataRemover::REMOVE_PASSWORDS); | 135 "passwords", BrowsingDataRemover::REMOVE_PASSWORDS); |
| 136 // We can't remove plugin data inside a test profile. | 136 // We can't remove plugin data inside a test profile. |
| 137 RunRemoveBrowsingDataFunctionAndCompareMask( | 137 RunRemoveBrowsingDataFunctionAndCompareMask( |
| 138 "webSQL", BrowsingDataRemover::REMOVE_WEBSQL); | 138 "webSQL", BrowsingDataRemover::REMOVE_WEBSQL); |
| 139 } | 139 } |
| OLD | NEW |