| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_MOCK_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
| 6 #define CHROME_BROWSER_MOCK_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <map> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/callback.h" |
| 13 #include "chrome/browser/browsing_data_file_system_helper.h" |
| 14 #include "webkit/fileapi/file_system_types.h" |
| 15 |
| 16 // Mock for BrowsingDataFileSystemHelper. |
| 17 // Use AddFileSystemSamples() or add directly to response_ vector, then call |
| 18 // Notify(). |
| 19 class MockBrowsingDataFileSystemHelper : public BrowsingDataFileSystemHelper { |
| 20 public: |
| 21 explicit MockBrowsingDataFileSystemHelper(Profile* profile); |
| 22 |
| 23 virtual void StartFetching( |
| 24 Callback1<const std::vector<FileSystemInfo>& >::Type* callback); |
| 25 |
| 26 virtual void CancelNotification(); |
| 27 |
| 28 virtual void DeleteFileSystemOrigin(const GURL& origin); |
| 29 |
| 30 // Adds a specific filesystem. |
| 31 void AddFileSystem(const GURL& origin, |
| 32 bool has_persistent, |
| 33 bool has_temporary); |
| 34 |
| 35 // Adds some FilesystemInfo samples. |
| 36 void AddFileSystemSamples(); |
| 37 |
| 38 // Notifies the callback. |
| 39 void Notify(); |
| 40 |
| 41 // Marks all filesystems as existing. |
| 42 void Reset(); |
| 43 |
| 44 // Returns true if all filesystemss since the last Reset() invokation were |
| 45 // deleted. |
| 46 bool AllDeleted(); |
| 47 |
| 48 GURL last_deleted_origin_; |
| 49 |
| 50 private: |
| 51 virtual ~MockBrowsingDataFileSystemHelper(); |
| 52 |
| 53 Profile* profile_; |
| 54 |
| 55 scoped_ptr<Callback1<const std::vector<FileSystemInfo>& >::Type > |
| 56 callback_; |
| 57 |
| 58 // Stores which filesystems exist. |
| 59 std::map<const std::string, bool> file_systems_; |
| 60 |
| 61 std::vector<FileSystemInfo> response_; |
| 62 }; |
| 63 |
| 64 #endif // CHROME_BROWSER_MOCK_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
| OLD | NEW |