Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_mock.h

Issue 9662041: Implement copy and move operations within the same remote file system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 gdata.h 5 // This file contains mocks for classes in gdata.h
6 6
7 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ 7 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_
8 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ 8 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_
9 #pragma once 9 #pragma once
10 10
11 #include <string>
12
11 #include "base/platform_file.h" 13 #include "base/platform_file.h"
12 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/chromeos/gdata/gdata.h" 15 #include "chrome/browser/chromeos/gdata/gdata.h"
14 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" 16 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
15 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
16 18
17 class FilePath; 19 class FilePath;
18 20
19 namespace gdata { 21 namespace gdata {
20 22
21 class MockDocumentsService : public DocumentsServiceInterface { 23 class MockDocumentsService : public DocumentsServiceInterface {
22 public: 24 public:
23 // DocumentsService is usually owned and created by GDataFileSystem. 25 // DocumentsService is usually owned and created by GDataFileSystem.
24 MockDocumentsService(); 26 MockDocumentsService();
25 virtual ~MockDocumentsService(); 27 virtual ~MockDocumentsService();
26 28
27 // DocumentServiceInterface overrides. 29 // DocumentServiceInterface overrides.
28 MOCK_METHOD1(Initialize, void(Profile*)); 30 MOCK_METHOD1(Initialize, void(Profile* profile));
29 MOCK_METHOD0(CancelAll, void(void)); 31 MOCK_METHOD0(CancelAll, void(void));
30 MOCK_METHOD1(Authenticate, void(const AuthStatusCallback& callback)); 32 MOCK_METHOD1(Authenticate, void(const AuthStatusCallback& callback));
31 MOCK_METHOD2(GetDocuments, void(const GURL& feed_url, 33 MOCK_METHOD2(GetDocuments, void(const GURL& feed_url,
32 const GetDataCallback& callback)); 34 const GetDataCallback& callback));
33 MOCK_METHOD2(DeleteDocument, void(const GURL& document_url, 35 MOCK_METHOD2(DeleteDocument, void(const GURL& document_url,
34 const EntryActionCallback& callback)); 36 const EntryActionCallback& callback));
35 MOCK_METHOD3(DownloadDocument, void(const GURL& content_url, 37 MOCK_METHOD3(DownloadDocument, void(const GURL& content_url,
36 DocumentExportFormat format, 38 DocumentExportFormat format,
37 const DownloadActionCallback& callback)); 39 const DownloadActionCallback& callback));
40 MOCK_METHOD3(CopyDocument, void(const GURL& document_url,
41 const FilePath::StringType& new_name,
42 const GetDataCallback& callback));
43 MOCK_METHOD3(RenameResource, void(const GURL& resource_url,
44 const FilePath::StringType& new_name,
45 const EntryActionCallback& callback));
46 MOCK_METHOD3(AddResourceToDirectory,
47 void(const GURL& parent_content_url,
48 const GURL& resource_url,
49 const EntryActionCallback& callback));
50 MOCK_METHOD4(RemoveResourceFromDirectory,
51 void(const GURL& parent_content_url,
52 const GURL& resource_url,
53 const std::string& resource_id,
54 const EntryActionCallback& callback));
38 MOCK_METHOD3(CreateDirectory, 55 MOCK_METHOD3(CreateDirectory,
39 void(const GURL& parent_content_url, 56 void(const GURL& parent_content_url,
40 const FilePath::StringType& directory_name, 57 const FilePath::StringType& directory_name,
41 const GetDataCallback& callback)); 58 const GetDataCallback& callback));
42 MOCK_METHOD2(DownloadFile, void(const GURL& content_url, 59 MOCK_METHOD2(DownloadFile, void(const GURL& content_url,
43 const DownloadActionCallback& callback)); 60 const DownloadActionCallback& callback));
44 MOCK_METHOD2(InitiateUpload, 61 MOCK_METHOD2(InitiateUpload,
45 void(const InitiateUploadParams& upload_file_info, 62 void(const InitiateUploadParams& upload_file_info,
46 const InitiateUploadCallback& callback)); 63 const InitiateUploadCallback& callback));
47 MOCK_METHOD2(ResumeUpload, void(const ResumeUploadParams& upload_file_info, 64 MOCK_METHOD2(ResumeUpload, void(const ResumeUploadParams& upload_file_info,
(...skipping 15 matching lines...) Expand all
63 void DeleteDocumentStub(const GURL& document_url, 80 void DeleteDocumentStub(const GURL& document_url,
64 const EntryActionCallback& callback); 81 const EntryActionCallback& callback);
65 82
66 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path 83 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path
67 // portion of the URL as the temporary file path. 84 // portion of the URL as the temporary file path.
68 void DownloadDocumentStub(const GURL& content_url, 85 void DownloadDocumentStub(const GURL& content_url,
69 DocumentExportFormat format, 86 DocumentExportFormat format,
70 const DownloadActionCallback& callback); 87 const DownloadActionCallback& callback);
71 88
72 // Will call |callback| with HTTP_SUCCESS and the current value of 89 // Will call |callback| with HTTP_SUCCESS and the current value of
90 // |document_data_|.
91 void CopyDocumentStub(const GURL& document_url,
92 const FilePath::StringType& new_name,
93 const GetDataCallback& callback);
94
95 // Will call |callback| with HTTP_SUCCESS and the |document_url|.
96 void RenameResourceStub(const GURL& document_url,
97 const FilePath::StringType& new_name,
98 const EntryActionCallback& callback);
99
100 // Will call |callback| with HTTP_SUCCESS and the |resource_url|.
101 void AddResourceToDirectoryStub(const GURL& parent_content_url,
102 const GURL& resource_url,
103 const EntryActionCallback& callback);
104
105 // Will call |callback| with HTTP_SUCCESS and the |resource_url|.
106 void RemoveResourceFromDirectoryStub(const GURL& parent_content_url,
107 const GURL& resource_url,
108 const std::string& resource_id,
109 const EntryActionCallback& callback);
110
111 // Will call |callback| with HTTP_SUCCESS and the current value of
73 // |directory_data_|. 112 // |directory_data_|.
74 void CreateDirectoryStub(const GURL& parent_content_url, 113 void CreateDirectoryStub(const GURL& parent_content_url,
75 const FilePath::StringType& directory_name, 114 const FilePath::StringType& directory_name,
76 const GetDataCallback& callback); 115 const GetDataCallback& callback);
77 116
78 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path 117 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path
79 // portion of the URL as the temporary file path. 118 // portion of the URL as the temporary file path.
80 void DownloadFileStub(const GURL& content_url, 119 void DownloadFileStub(const GURL& content_url,
81 const DownloadActionCallback& callback); 120 const DownloadActionCallback& callback);
82 121
83 void set_feed_data(base::Value* document_data) { 122 void set_feed_data(base::Value* document_data) {
84 feed_data_.reset(document_data); 123 feed_data_.reset(document_data);
85 } 124 }
86 125
87 void set_directory_data(base::Value* document_data) { 126 void set_directory_data(base::Value* document_data) {
88 directory_data_.reset(document_data); 127 directory_data_.reset(document_data);
89 } 128 }
90 129
91 private: 130 private:
92 // Feed data to be returned from GetDocuments. 131 // Feed data to be returned from GetDocuments.
93 scoped_ptr<base::Value> feed_data_; 132 scoped_ptr<base::Value> feed_data_;
94 133
95 // Feed data to be returned from CreateDirectory. 134 // Feed data to be returned from CreateDirectory.
96 scoped_ptr<base::Value> directory_data_; 135 scoped_ptr<base::Value> directory_data_;
136
137 // Feed data to be returned from CopyDocument.
138 scoped_ptr<base::Value> document_data_;
97 }; 139 };
98 140
99 } // namespace gdata 141 } // namespace gdata
100 142
101 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ 143 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698