| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/path_service.h" | 5 #include "base/path_service.h" |
| 6 #include "chrome/browser/apps/app_browsertest_util.h" | 6 #include "chrome/browser/apps/app_browsertest_util.h" |
| 7 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 7 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 8 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 8 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system_util.h" | 9 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 10 #include "chrome/browser/chromeos/drive/test_util.h" | |
| 11 #include "chrome/browser/drive/fake_drive_service.h" | 10 #include "chrome/browser/drive/fake_drive_service.h" |
| 12 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 11 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 13 #include "chrome/browser/extensions/component_loader.h" | 12 #include "chrome/browser/extensions/component_loader.h" |
| 14 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
| 15 #include "content/public/test/test_utils.h" | 14 #include "content/public/test/test_utils.h" |
| 16 #include "google_apis/drive/drive_api_parser.h" | 15 #include "google_apis/drive/drive_api_parser.h" |
| 17 #include "google_apis/drive/test_util.h" | 16 #include "google_apis/drive/test_util.h" |
| 18 | 17 |
| 19 namespace extensions { | 18 namespace extensions { |
| 20 | 19 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 46 // Ensure the fake service's data is fetch in the local file system. This is | 45 // Ensure the fake service's data is fetch in the local file system. This is |
| 47 // necessary because the fetch starts lazily upon the first read operation. | 46 // necessary because the fetch starts lazily upon the first read operation. |
| 48 virtual void SetUpOnMainThread() OVERRIDE { | 47 virtual void SetUpOnMainThread() OVERRIDE { |
| 49 PlatformAppBrowserTest::SetUpOnMainThread(); | 48 PlatformAppBrowserTest::SetUpOnMainThread(); |
| 50 | 49 |
| 51 scoped_ptr<drive::ResourceEntry> entry; | 50 scoped_ptr<drive::ResourceEntry> entry; |
| 52 drive::FileError error = drive::FILE_ERROR_FAILED; | 51 drive::FileError error = drive::FILE_ERROR_FAILED; |
| 53 integration_service_->file_system()->GetResourceEntry( | 52 integration_service_->file_system()->GetResourceEntry( |
| 54 base::FilePath::FromUTF8Unsafe("drive/root"), // whatever | 53 base::FilePath::FromUTF8Unsafe("drive/root"), // whatever |
| 55 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 54 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 56 drive::test_util::RunBlockingPoolTask(); | 55 content::RunAllBlockingPoolTasksUntilIdle(); |
| 57 ASSERT_EQ(drive::FILE_ERROR_OK, error); | 56 ASSERT_EQ(drive::FILE_ERROR_OK, error); |
| 58 } | 57 } |
| 59 | 58 |
| 60 virtual void TearDown() OVERRIDE { | 59 virtual void TearDown() OVERRIDE { |
| 61 FileSystemChooseEntryFunction::StopSkippingPickerForTest(); | 60 FileSystemChooseEntryFunction::StopSkippingPickerForTest(); |
| 62 PlatformAppBrowserTest::TearDown(); | 61 PlatformAppBrowserTest::TearDown(); |
| 63 }; | 62 }; |
| 64 | 63 |
| 65 private: | 64 private: |
| 66 drive::DriveIntegrationService* CreateDriveIntegrationService( | 65 drive::DriveIntegrationService* CreateDriveIntegrationService( |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 FileSystemApiSaveExistingFileWithWriteTest) { | 247 FileSystemApiSaveExistingFileWithWriteTest) { |
| 249 base::FilePath test_file = drive::util::GetDriveMountPointPath( | 248 base::FilePath test_file = drive::util::GetDriveMountPointPath( |
| 250 browser()->profile()).AppendASCII("root/save_existing.txt"); | 249 browser()->profile()).AppendASCII("root/save_existing.txt"); |
| 251 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 250 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
| 252 &test_file); | 251 &test_file); |
| 253 ASSERT_TRUE(RunPlatformAppTest( | 252 ASSERT_TRUE(RunPlatformAppTest( |
| 254 "api_test/file_system/save_existing_with_write")) << message_; | 253 "api_test/file_system/save_existing_with_write")) << message_; |
| 255 } | 254 } |
| 256 | 255 |
| 257 } // namespace extensions | 256 } // namespace extensions |
| OLD | NEW |