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 "chrome/browser/apps/app_browsertest_util.h" | 5 #include "chrome/browser/apps/app_browsertest_util.h" |
6 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 6 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
7 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 7 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
8 #include "chrome/browser/chromeos/drive/file_system_util.h" | 8 #include "chrome/browser/chromeos/drive/file_system_util.h" |
9 #include "chrome/browser/chromeos/drive/test_util.h" | 9 #include "chrome/browser/chromeos/drive/test_util.h" |
10 #include "chrome/browser/drive/fake_drive_service.h" | 10 #include "chrome/browser/drive/fake_drive_service.h" |
11 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 11 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 12 #include "chrome/browser/extensions/component_loader.h" |
12 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
13 #include "google_apis/drive/test_util.h" | 14 #include "google_apis/drive/test_util.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 // This class contains chrome.filesystem API test specific to Chrome OS, namely, | 18 // This class contains chrome.filesystem API test specific to Chrome OS, namely, |
18 // the integrated Google Drive support. | 19 // the integrated Google Drive support. |
19 class FileSystemApiTestForDrive : public PlatformAppBrowserTest { | 20 class FileSystemApiTestForDrive : public PlatformAppBrowserTest { |
20 public: | 21 public: |
21 FileSystemApiTestForDrive() | 22 FileSystemApiTestForDrive() |
22 : fake_drive_service_(NULL), | 23 : fake_drive_service_(NULL), |
23 integration_service_(NULL) { | 24 integration_service_(NULL) { |
24 } | 25 } |
25 | 26 |
26 // Sets up fake Drive service for tests (this has to be injected before the | 27 // Sets up fake Drive service for tests (this has to be injected before the |
27 // real DriveIntegrationService instance is created.) | 28 // real DriveIntegrationService instance is created.) |
28 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 29 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
29 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture(); | 30 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 31 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); |
30 | 32 |
31 ASSERT_TRUE(test_cache_root_.CreateUniqueTempDir()); | 33 ASSERT_TRUE(test_cache_root_.CreateUniqueTempDir()); |
32 | 34 |
33 create_drive_integration_service_ = | 35 create_drive_integration_service_ = |
34 base::Bind(&FileSystemApiTestForDrive::CreateDriveIntegrationService, | 36 base::Bind(&FileSystemApiTestForDrive::CreateDriveIntegrationService, |
35 base::Unretained(this)); | 37 base::Unretained(this)); |
36 service_factory_for_test_.reset( | 38 service_factory_for_test_.reset( |
37 new drive::DriveIntegrationServiceFactory::ScopedFactoryForTest( | 39 new drive::DriveIntegrationServiceFactory::ScopedFactoryForTest( |
38 &create_drive_integration_service_)); | 40 &create_drive_integration_service_)); |
39 } | 41 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 drive::util::GetDriveMountPointPath(browser()->profile()).AppendASCII( | 178 drive::util::GetDriveMountPointPath(browser()->profile()).AppendASCII( |
177 "root/subdir"); | 179 "root/subdir"); |
178 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 180 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
179 &test_directory); | 181 &test_directory); |
180 ASSERT_TRUE(RunPlatformAppTest( | 182 ASSERT_TRUE(RunPlatformAppTest( |
181 "api_test/file_system/open_directory_with_only_write")) | 183 "api_test/file_system/open_directory_with_only_write")) |
182 << message_; | 184 << message_; |
183 } | 185 } |
184 | 186 |
185 } // namespace extensions | 187 } // namespace extensions |
OLD | NEW |