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 // This file contains mocks for classes in drive_service_interface.h | 5 // This file contains mocks for classes in drive_service_interface.h |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_MOCK_DRIVE_SERVICE_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_MOCK_DRIVE_SERVICE_H_ |
8 #define CHROME_BROWSER_CHROMEOS_GDATA_MOCK_DRIVE_SERVICE_H_ | 8 #define CHROME_BROWSER_CHROMEOS_GDATA_MOCK_DRIVE_SERVICE_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/chromeos/gdata/drive_service_interface.h" | 13 #include "chrome/browser/chromeos/gdata/drive_service_interface.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 | 15 |
16 class FilePath; | 16 class FilePath; |
17 | 17 |
18 namespace gdata { | 18 namespace gdata { |
19 | 19 |
20 class MockDriveService : public DriveServiceInterface { | 20 class MockDriveService : public DriveServiceInterface { |
21 public: | 21 public: |
22 // DriveService is usually owned and created by DriveFileSystem. | 22 // DriveService is usually owned and created by DriveFileSystem. |
23 MockDriveService(); | 23 MockDriveService(); |
24 virtual ~MockDriveService(); | 24 virtual ~MockDriveService(); |
25 | 25 |
26 // DriveServiceInterface overrides. | 26 // DriveServiceInterface overrides. |
27 MOCK_METHOD1(Initialize, void(Profile* profile)); | 27 MOCK_METHOD1(Initialize, void(Profile* profile)); |
28 MOCK_METHOD1(AddObserver, void(DriveServiceObserver* observer)); | 28 MOCK_METHOD1(AddObserver, void(DriveServiceObserver* observer)); |
29 MOCK_METHOD1(RemoveObserver, void(DriveServiceObserver* observer)); | 29 MOCK_METHOD1(RemoveObserver, void(DriveServiceObserver* observer)); |
30 MOCK_CONST_METHOD0(operation_registry, OperationRegistry*()); | |
31 MOCK_CONST_METHOD0(CanStartOperation, bool()); | 30 MOCK_CONST_METHOD0(CanStartOperation, bool()); |
32 MOCK_METHOD0(CancelAll, void(void)); | 31 MOCK_METHOD0(CancelAll, void(void)); |
| 32 MOCK_METHOD1(CancelForFilePath, bool(const FilePath& file_path)); |
| 33 MOCK_CONST_METHOD0(GetProgressStatusList, OperationProgressStatusList()); |
33 MOCK_METHOD1(Authenticate, void(const AuthStatusCallback& callback)); | 34 MOCK_METHOD1(Authenticate, void(const AuthStatusCallback& callback)); |
34 MOCK_METHOD5(GetDocuments, void(const GURL& feed_url, | 35 MOCK_METHOD5(GetDocuments, void(const GURL& feed_url, |
35 int64 start_changestamp, | 36 int64 start_changestamp, |
36 const std::string& search_string, | 37 const std::string& search_string, |
37 const std::string& directory_resource_id, | 38 const std::string& directory_resource_id, |
38 const GetDataCallback& callback)); | 39 const GetDataCallback& callback)); |
39 MOCK_METHOD2(GetDocumentEntry, void(const std::string& resource_id, | 40 MOCK_METHOD2(GetDocumentEntry, void(const std::string& resource_id, |
40 const GetDataCallback& callback)); | 41 const GetDataCallback& callback)); |
41 MOCK_METHOD1(GetAccountMetadata, void(const GetDataCallback& callback)); | 42 MOCK_METHOD1(GetAccountMetadata, void(const GetDataCallback& callback)); |
42 MOCK_METHOD1(GetApplicationInfo, void(const GetDataCallback& callback)); | 43 MOCK_METHOD1(GetApplicationInfo, void(const GetDataCallback& callback)); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 scoped_ptr<base::Value> search_result_; | 189 scoped_ptr<base::Value> search_result_; |
189 | 190 |
190 // File data to be written to the local temporary file when | 191 // File data to be written to the local temporary file when |
191 // DownloadDocumentStub is called. | 192 // DownloadDocumentStub is called. |
192 scoped_ptr<std::string> file_data_; | 193 scoped_ptr<std::string> file_data_; |
193 }; | 194 }; |
194 | 195 |
195 } // namespace gdata | 196 } // namespace gdata |
196 | 197 |
197 #endif // CHROME_BROWSER_CHROMEOS_GDATA_MOCK_DRIVE_SERVICE_H_ | 198 #endif // CHROME_BROWSER_CHROMEOS_GDATA_MOCK_DRIVE_SERVICE_H_ |
OLD | NEW |