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/profiles/profile_helper.h" |
10 #include "chrome/browser/drive/fake_drive_service.h" | 11 #include "chrome/browser/drive/fake_drive_service.h" |
11 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 12 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
12 #include "chrome/browser/extensions/component_loader.h" | 13 #include "chrome/browser/extensions/component_loader.h" |
13 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
14 #include "content/public/test/test_utils.h" | 15 #include "content/public/test/test_utils.h" |
15 #include "google_apis/drive/drive_api_parser.h" | 16 #include "google_apis/drive/drive_api_parser.h" |
16 #include "google_apis/drive/test_util.h" | 17 #include "google_apis/drive/test_util.h" |
17 | 18 |
18 namespace extensions { | 19 namespace extensions { |
19 | 20 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 58 } |
58 | 59 |
59 void TearDown() override { | 60 void TearDown() override { |
60 FileSystemChooseEntryFunction::StopSkippingPickerForTest(); | 61 FileSystemChooseEntryFunction::StopSkippingPickerForTest(); |
61 PlatformAppBrowserTest::TearDown(); | 62 PlatformAppBrowserTest::TearDown(); |
62 }; | 63 }; |
63 | 64 |
64 private: | 65 private: |
65 drive::DriveIntegrationService* CreateDriveIntegrationService( | 66 drive::DriveIntegrationService* CreateDriveIntegrationService( |
66 Profile* profile) { | 67 Profile* profile) { |
| 68 // Ignore signin profile. |
| 69 if (profile->GetPath() == chromeos::ProfileHelper::GetSigninProfileDir()) |
| 70 return NULL; |
| 71 |
| 72 // FileSystemApiTestForDrive doesn't expect that several user profiles could |
| 73 // exist simultaneously. |
| 74 CHECK(fake_drive_service_ == NULL); |
67 fake_drive_service_ = new drive::FakeDriveService; | 75 fake_drive_service_ = new drive::FakeDriveService; |
68 fake_drive_service_->LoadAppListForDriveApi("drive/applist.json"); | 76 fake_drive_service_->LoadAppListForDriveApi("drive/applist.json"); |
69 | 77 |
70 SetUpTestFileHierarchy(); | 78 SetUpTestFileHierarchy(); |
71 | 79 |
72 integration_service_ = new drive::DriveIntegrationService( | 80 integration_service_ = new drive::DriveIntegrationService( |
73 profile, NULL, fake_drive_service_, std::string(), | 81 profile, NULL, fake_drive_service_, std::string(), |
74 test_cache_root_.path(), NULL); | 82 test_cache_root_.path(), NULL); |
75 return integration_service_; | 83 return integration_service_; |
76 } | 84 } |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 FileSystemApiSaveExistingFileWithWriteTest) { | 255 FileSystemApiSaveExistingFileWithWriteTest) { |
248 base::FilePath test_file = drive::util::GetDriveMountPointPath( | 256 base::FilePath test_file = drive::util::GetDriveMountPointPath( |
249 browser()->profile()).AppendASCII("root/save_existing.txt"); | 257 browser()->profile()).AppendASCII("root/save_existing.txt"); |
250 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 258 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
251 &test_file); | 259 &test_file); |
252 ASSERT_TRUE(RunPlatformAppTest( | 260 ASSERT_TRUE(RunPlatformAppTest( |
253 "api_test/file_system/save_existing_with_write")) << message_; | 261 "api_test/file_system/save_existing_with_write")) << message_; |
254 } | 262 } |
255 | 263 |
256 } // namespace extensions | 264 } // namespace extensions |
OLD | NEW |