| 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/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 #if BUILDFLAG(ANDROID_JAVA_UI) | 267 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 268 class TestWebappRegistry : public WebappRegistry { | 268 class TestWebappRegistry : public WebappRegistry { |
| 269 public: | 269 public: |
| 270 TestWebappRegistry() : WebappRegistry() { } | 270 TestWebappRegistry() : WebappRegistry() { } |
| 271 | 271 |
| 272 void UnregisterWebapps(const base::Closure& callback) override { | 272 void UnregisterWebapps(const base::Closure& callback) override { |
| 273 // Mocks out a JNI call and runs the callback as a delayed task. | 273 // Mocks out a JNI call and runs the callback as a delayed task. |
| 274 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback, | 274 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback, |
| 275 base::TimeDelta::FromMilliseconds(10)); | 275 base::TimeDelta::FromMilliseconds(10)); |
| 276 } | 276 } |
| 277 |
| 278 void ClearWebappHistory(const base::Closure& callback) override { |
| 279 // Mocks out a JNI call and runs the callback as a delayed task. |
| 280 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, callback, |
| 281 base::TimeDelta::FromMilliseconds(10)); |
| 282 } |
| 277 }; | 283 }; |
| 278 #endif | 284 #endif |
| 279 | 285 |
| 280 // Custom matcher to test the equivalence of two URL filters. Since those are | 286 // Custom matcher to test the equivalence of two URL filters. Since those are |
| 281 // blackbox predicates, we can only approximate the equivalence by testing | 287 // blackbox predicates, we can only approximate the equivalence by testing |
| 282 // whether the filter give the same answer for several URLs. This is currently | 288 // whether the filter give the same answer for several URLs. This is currently |
| 283 // good enough for our testing purposes, to distinguish whitelists | 289 // good enough for our testing purposes, to distinguish whitelists |
| 284 // and blacklists, empty and non-empty filters and such. | 290 // and blacklists, empty and non-empty filters and such. |
| 285 // TODO(msramek): BrowsingDataRemover and some of its backends support URL | 291 // TODO(msramek): BrowsingDataRemover and some of its backends support URL |
| 286 // filters, but its constructor currently only takes a single URL and constructs | 292 // filters, but its constructor currently only takes a single URL and constructs |
| (...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2300 EXPECT_CALL(*tester.store(), RemoveLoginsByURLAndTimeImpl(_, _, _)) | 2306 EXPECT_CALL(*tester.store(), RemoveLoginsByURLAndTimeImpl(_, _, _)) |
| 2301 .WillOnce(Return(password_manager::PasswordStoreChangeList())); | 2307 .WillOnce(Return(password_manager::PasswordStoreChangeList())); |
| 2302 EXPECT_CALL(*tester.store(), DisableAutoSignInForAllLoginsImpl()) | 2308 EXPECT_CALL(*tester.store(), DisableAutoSignInForAllLoginsImpl()) |
| 2303 .WillOnce(Return(password_manager::PasswordStoreChangeList())); | 2309 .WillOnce(Return(password_manager::PasswordStoreChangeList())); |
| 2304 | 2310 |
| 2305 BlockUntilBrowsingDataRemoved(BrowsingDataRemover::EVERYTHING, | 2311 BlockUntilBrowsingDataRemoved(BrowsingDataRemover::EVERYTHING, |
| 2306 BrowsingDataRemover::REMOVE_COOKIES | | 2312 BrowsingDataRemover::REMOVE_COOKIES | |
| 2307 BrowsingDataRemover::REMOVE_PASSWORDS, | 2313 BrowsingDataRemover::REMOVE_PASSWORDS, |
| 2308 false); | 2314 false); |
| 2309 } | 2315 } |
| OLD | NEW |