| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
| 13 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" | 15 #include "chrome/browser/chromeos/gdata/drive_file_system.h" |
| 16 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" | 16 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" |
| 17 #include "chrome/browser/chromeos/gdata/gdata_util.h" | 17 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
| 18 #include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" | 18 #include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" |
| 19 #include "chrome/browser/chromeos/gdata/mock_drive_service.h" | 19 #include "chrome/browser/chromeos/gdata/mock_drive_service.h" |
| 20 #include "chrome/browser/chromeos/gdata/operation_registry.h" | 20 #include "chrome/browser/chromeos/gdata/operation_registry.h" |
| 21 #include "chrome/browser/extensions/extension_apitest.h" | 21 #include "chrome/browser/extensions/extension_apitest.h" |
| 22 #include "chrome/browser/extensions/extension_test_message_listener.h" | 22 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void WaitUntilClosed() { | 81 void WaitUntilClosed() { |
| 82 page_closed_.Wait(); | 82 page_closed_.Wait(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 content::WindowedNotificationObserver page_created_; | 86 content::WindowedNotificationObserver page_created_; |
| 87 content::WindowedNotificationObserver page_closed_; | 87 content::WindowedNotificationObserver page_closed_; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 // TODO(tbarzic): We should probably share GetTestFilePath and LoadJSONFile | 90 // TODO(tbarzic): We should probably share GetTestFilePath and LoadJSONFile |
| 91 // with gdata_file_system_unittest. | 91 // with drive_file_system_unittest. |
| 92 // Generates file path in gdata test directory for a file with name |filename|. | 92 // Generates file path in gdata test directory for a file with name |filename|. |
| 93 FilePath GetTestFilePath(const FilePath::StringType& filename) { | 93 FilePath GetTestFilePath(const FilePath::StringType& filename) { |
| 94 FilePath path; | 94 FilePath path; |
| 95 std::string error; | 95 std::string error; |
| 96 PathService::Get(chrome::DIR_TEST_DATA, &path); | 96 PathService::Get(chrome::DIR_TEST_DATA, &path); |
| 97 path = path.AppendASCII("chromeos") | 97 path = path.AppendASCII("chromeos") |
| 98 .AppendASCII("gdata") | 98 .AppendASCII("gdata") |
| 99 .AppendASCII(filename); | 99 .AppendASCII(filename); |
| 100 EXPECT_TRUE(file_util::PathExists(path)) << | 100 EXPECT_TRUE(file_util::PathExists(path)) << |
| 101 "Couldn't find " << path.value(); | 101 "Couldn't find " << path.value(); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 _, _)) | 355 _, _)) |
| 356 .WillOnce(MockDownloadFileCallback(gdata::HTTP_SUCCESS)); | 356 .WillOnce(MockDownloadFileCallback(gdata::HTTP_SUCCESS)); |
| 357 | 357 |
| 358 // On exit, all operations in progress should be cancelled. | 358 // On exit, all operations in progress should be cancelled. |
| 359 EXPECT_CALL(*mock_drive_service_, CancelAll()); | 359 EXPECT_CALL(*mock_drive_service_, CancelAll()); |
| 360 | 360 |
| 361 // All is set... RUN THE TEST. | 361 // All is set... RUN THE TEST. |
| 362 EXPECT_TRUE(RunExtensionSubtest("filebrowser_component", "remote_search.html", | 362 EXPECT_TRUE(RunExtensionSubtest("filebrowser_component", "remote_search.html", |
| 363 kComponentFlags)) << message_; | 363 kComponentFlags)) << message_; |
| 364 } | 364 } |
| OLD | NEW |