Index: chrome/browser/chromeos/extensions/external_filesystem_apitest.cc |
diff --git a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc |
index 6639465725966bccf9d20156bcd27b61169ab05e..bd292b628f3477d263d393095b2215d1f12ee6a7 100644 |
--- a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc |
+++ b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc |
@@ -18,7 +18,7 @@ |
#include "chrome/browser/chromeos/gdata/gdata_system_service.h" |
#include "chrome/browser/chromeos/gdata/gdata_util.h" |
#include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" |
-#include "chrome/browser/chromeos/gdata/mock_documents_service.h" |
+#include "chrome/browser/chromeos/gdata/mock_drive_service.h" |
#include "chrome/browser/extensions/extension_apitest.h" |
#include "chrome/browser/extensions/extension_test_message_listener.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -204,31 +204,31 @@ class RemoteFileSystemExtensionApiTest : public ExtensionApiTest { |
gdata::GDataSystemServiceFactory::set_cache_root_for_test( |
test_cache_root_.path().value()); |
- mock_documents_service_ = new gdata::MockDocumentsService(); |
+ mock_drive_service_ = new gdata::MockDriveService(); |
operation_registry_.reset(new gdata::GDataOperationRegistry()); |
// FileBrowserEventRouter will add and remove itself from operation registry |
// observer list. |
- EXPECT_CALL(*mock_documents_service_, operation_registry()). |
+ EXPECT_CALL(*mock_drive_service_, operation_registry()). |
WillRepeatedly(Return(operation_registry_.get())); |
- // |mock_documents_service_| will eventually get owned by a system service. |
- gdata::GDataSystemServiceFactory::set_documents_service_for_test( |
- mock_documents_service_); |
+ // |mock_drive_service_| will eventually get owned by a system service. |
+ gdata::GDataSystemServiceFactory::set_drive_service_for_test( |
+ mock_drive_service_); |
ExtensionApiTest::SetUp(); |
} |
virtual void TearDown() OVERRIDE { |
// Let's make sure we don't leak documents service. |
- gdata::GDataSystemServiceFactory::set_documents_service_for_test(NULL); |
+ gdata::GDataSystemServiceFactory::set_drive_service_for_test(NULL); |
gdata::GDataSystemServiceFactory::set_cache_root_for_test(std::string()); |
ExtensionApiTest::TearDown(); |
} |
protected: |
ScopedTempDir test_cache_root_; |
- gdata::MockDocumentsService* mock_documents_service_; |
+ gdata::MockDriveService* mock_drive_service_; |
scoped_ptr<gdata::GDataOperationRegistry> operation_registry_; |
}; |
@@ -278,18 +278,18 @@ IN_PROC_BROWSER_TEST_F(FileSystemExtensionApiTest, |
IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest, |
RemoteMountPoint) { |
- EXPECT_CALL(*mock_documents_service_, GetAccountMetadata(_)).Times(1); |
+ EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1); |
// First, file browser will try to create new directory. |
scoped_ptr<base::Value> dir_value(LoadJSONFile(kTestDirectory)); |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
CreateDirectory(_, _, _)) |
.WillOnce(MockCreateDirectoryCallback(gdata::HTTP_SUCCESS, &dir_value)); |
// Then the test will try to read an existing file file. |
// Remote filesystem should first request root feed from gdata server. |
scoped_ptr<base::Value> documents_value(LoadJSONFile(kTestRootFeed)); |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
GetDocuments(_, _, _, _, _)) |
.WillOnce(MockGetDocumentsCallback(gdata::HTTP_SUCCESS, |
&documents_value)); |
@@ -303,20 +303,20 @@ IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest, |
// copy is already present in the cache. |
scoped_ptr<base::Value> document_to_download_value( |
LoadJSONFile(kTestDocumentToDownloadEntry)); |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
GetDocumentEntry("file:1_file_resource_id", _)) |
.WillOnce(MockGetDocumentEntryCallback(gdata::HTTP_SUCCESS, |
&document_to_download_value)); |
// We expect to download url defined in document entry returned by |
// GetDocumentEntry mock implementation. |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
DownloadFile(_, _, GURL("https://file_content_url_changed"), |
_, _)) |
.WillOnce(MockDownloadFileCallback(gdata::HTTP_SUCCESS)); |
// On exit, all operations in progress should be cancelled. |
- EXPECT_CALL(*mock_documents_service_, CancelAll()); |
+ EXPECT_CALL(*mock_drive_service_, CancelAll()); |
// All is set... RUN THE TEST. |
EXPECT_TRUE(RunExtensionTest("filesystem_handler")) << message_; |
@@ -325,18 +325,18 @@ IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest, |
} |
IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest, ContentSearch) { |
- EXPECT_CALL(*mock_documents_service_, GetAccountMetadata(_)).Times(1); |
+ EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1); |
// First, test will get drive root directory, to init file system. |
scoped_ptr<base::Value> documents_value(LoadJSONFile(kTestRootFeed)); |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
GetDocuments(_, _, "", _, _)) |
.WillOnce(MockGetDocumentsCallback(gdata::HTTP_SUCCESS, |
&documents_value)); |
// We return the whole test file system in serch results. |
scoped_ptr<base::Value> search_value(LoadJSONFile(kTestRootFeed)); |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
GetDocuments(_, _, "foo", _, _)) |
.WillOnce(MockGetDocumentsCallback(gdata::HTTP_SUCCESS, |
&search_value)); |
@@ -344,20 +344,20 @@ IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest, ContentSearch) { |
// Test will try to create a snapshot of the returned file. |
scoped_ptr<base::Value> document_to_download_value( |
LoadJSONFile(kTestDocumentToDownloadEntry)); |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
GetDocumentEntry("file:1_file_resource_id", _)) |
.WillOnce(MockGetDocumentEntryCallback(gdata::HTTP_SUCCESS, |
&document_to_download_value)); |
// We expect to download url defined in document entry returned by |
// GetDocumentEntry mock implementation. |
- EXPECT_CALL(*mock_documents_service_, |
+ EXPECT_CALL(*mock_drive_service_, |
DownloadFile(_, _, GURL("https://file_content_url_changed"), |
_, _)) |
.WillOnce(MockDownloadFileCallback(gdata::HTTP_SUCCESS)); |
// On exit, all operations in progress should be cancelled. |
- EXPECT_CALL(*mock_documents_service_, CancelAll()); |
+ EXPECT_CALL(*mock_drive_service_, CancelAll()); |
// All is set... RUN THE TEST. |
EXPECT_TRUE(RunExtensionSubtest("filebrowser_component", "remote_search.html", |