OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/mock_browsing_data_local_storage_helper.h" |
| 6 |
| 7 MockBrowsingDataLocalStorageHelper::MockBrowsingDataLocalStorageHelper( |
| 8 Profile* profile) |
| 9 : BrowsingDataLocalStorageHelper(profile), |
| 10 profile_(profile), |
| 11 callback_(NULL), |
| 12 delete_all_files_called_(false) { |
| 13 } |
| 14 |
| 15 void MockBrowsingDataLocalStorageHelper::StartFetching( |
| 16 Callback1<const std::vector<LocalStorageInfo>& >::Type* callback) { |
| 17 callback_ = callback; |
| 18 } |
| 19 |
| 20 void MockBrowsingDataLocalStorageHelper::CancelNotification() { |
| 21 callback_ = NULL; |
| 22 } |
| 23 |
| 24 void MockBrowsingDataLocalStorageHelper::DeleteLocalStorageFile( |
| 25 const FilePath& file_path) { |
| 26 last_deleted_file_ = file_path; |
| 27 } |
| 28 |
| 29 void MockBrowsingDataLocalStorageHelper::DeleteAllLocalStorageFiles() { |
| 30 delete_all_files_called_ = true; |
| 31 } |
| 32 |
| 33 void MockBrowsingDataLocalStorageHelper::AddLocalStorageSamples() { |
| 34 response_.push_back( |
| 35 BrowsingDataLocalStorageHelper::LocalStorageInfo( |
| 36 "http", "host1", 1, "db1", "origin1", |
| 37 FilePath(FILE_PATH_LITERAL("file1")), 1, base::Time())); |
| 38 response_.push_back( |
| 39 BrowsingDataLocalStorageHelper::LocalStorageInfo( |
| 40 "http", "host2", 2, "db2", "origin2", |
| 41 FilePath(FILE_PATH_LITERAL("file2")), 2, base::Time())); |
| 42 } |
| 43 |
| 44 void MockBrowsingDataLocalStorageHelper::Notify() { |
| 45 CHECK(callback_); |
| 46 callback_->Run(response_); |
| 47 } |
OLD | NEW |