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/chromeos/drive/drive_integration_service.h" | 5 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
6 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 6 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
7 #include "chrome/browser/chromeos/file_manager/mount_test_util.h" | 7 #include "chrome/browser/chromeos/file_manager/mount_test_util.h" |
8 #include "chrome/test/base/testing_browser_process.h" | 8 #include "chrome/test/base/testing_browser_process.h" |
9 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
10 #include "chrome/test/base/testing_profile_manager.h" | 10 #include "chrome/test/base/testing_profile_manager.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 TEST(FileManagerFileAPIUtilTest, | 49 TEST(FileManagerFileAPIUtilTest, |
50 ConvertSelectedFileInfoListToFileChooserFileInfoList) { | 50 ConvertSelectedFileInfoListToFileChooserFileInfoList) { |
51 // Prepare the test drive environment. | 51 // Prepare the test drive environment. |
52 content::TestBrowserThreadBundle threads; | 52 content::TestBrowserThreadBundle threads; |
53 TestingProfileManager profile_manager(TestingBrowserProcess::GetGlobal()); | 53 TestingProfileManager profile_manager(TestingBrowserProcess::GetGlobal()); |
54 ASSERT_TRUE(profile_manager.SetUp()); | 54 ASSERT_TRUE(profile_manager.SetUp()); |
55 base::ScopedTempDir drive_cache_dir; | 55 base::ScopedTempDir drive_cache_dir; |
56 ASSERT_TRUE(drive_cache_dir.CreateUniqueTempDir()); | 56 ASSERT_TRUE(drive_cache_dir.CreateUniqueTempDir()); |
57 drive::DriveIntegrationServiceFactory::FactoryCallback factory_callback( | 57 drive::DriveIntegrationServiceFactory::FactoryCallback factory_callback( |
58 base::Bind(&CreateDriveIntegrationService, drive_cache_dir.path())); | 58 base::Bind(&CreateDriveIntegrationService, drive_cache_dir.GetPath())); |
59 drive::DriveIntegrationServiceFactory::ScopedFactoryForTest | 59 drive::DriveIntegrationServiceFactory::ScopedFactoryForTest |
60 integration_service_factory_scope(&factory_callback); | 60 integration_service_factory_scope(&factory_callback); |
61 | 61 |
62 // Prepare the test profile. | 62 // Prepare the test profile. |
63 Profile* const profile = profile_manager.CreateTestingProfile("test-user"); | 63 Profile* const profile = profile_manager.CreateTestingProfile("test-user"); |
64 drive::DriveIntegrationService* const service = | 64 drive::DriveIntegrationService* const service = |
65 drive::DriveIntegrationServiceFactory::GetForProfile(profile); | 65 drive::DriveIntegrationServiceFactory::GetForProfile(profile); |
66 service->SetEnabled(true); | 66 service->SetEnabled(true); |
67 test_util::WaitUntilDriveMountPointIsAdded(profile); | 67 test_util::WaitUntilDriveMountPointIsAdded(profile); |
68 ASSERT_TRUE(service->IsMounted()); | 68 ASSERT_TRUE(service->IsMounted()); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 context->CrackURL(result[2].file_system_url); | 135 context->CrackURL(result[2].file_system_url); |
136 EXPECT_EQ(GURL("http://example.com"), url.origin()); | 136 EXPECT_EQ(GURL("http://example.com"), url.origin()); |
137 EXPECT_EQ(storage::kFileSystemTypeIsolated, url.mount_type()); | 137 EXPECT_EQ(storage::kFileSystemTypeIsolated, url.mount_type()); |
138 EXPECT_EQ(storage::kFileSystemTypeDrive, url.type()); | 138 EXPECT_EQ(storage::kFileSystemTypeDrive, url.type()); |
139 EXPECT_EQ(26u, result[2].length); | 139 EXPECT_EQ(26u, result[2].length); |
140 } | 140 } |
141 | 141 |
142 } // namespace | 142 } // namespace |
143 } // namespace util | 143 } // namespace util |
144 } // namespace file_manager | 144 } // namespace file_manager |
OLD | NEW |