OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // Browser test for basic Chrome OS file manager functionality: | 5 // Browser test for basic Chrome OS file manager functionality: |
6 // - The file list is updated when a file is added externally to the Downloads | 6 // - The file list is updated when a file is added externally to the Downloads |
7 // folder. | 7 // folder. |
8 // - Selecting a file and copy-pasting it with the keyboard copies the file. | 8 // - Selecting a file and copy-pasting it with the keyboard copies the file. |
9 // - Selecting a file and pressing delete deletes it. | 9 // - Selecting a file and pressing delete deletes it. |
10 | 10 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 integration_service_(NULL) { | 269 integration_service_(NULL) { |
270 } | 270 } |
271 | 271 |
272 // Sends request to add this volume to the file system as Google drive. | 272 // Sends request to add this volume to the file system as Google drive. |
273 // This method must be calld at SetUp method of FileManagerBrowserTestBase. | 273 // This method must be calld at SetUp method of FileManagerBrowserTestBase. |
274 // Returns true on success. | 274 // Returns true on success. |
275 bool SetUp() { | 275 bool SetUp() { |
276 if (!test_cache_root_.CreateUniqueTempDir()) | 276 if (!test_cache_root_.CreateUniqueTempDir()) |
277 return false; | 277 return false; |
278 drive::DriveIntegrationServiceFactory::SetFactoryForTest( | 278 drive::DriveIntegrationServiceFactory::SetFactoryForTest( |
279 base::Bind(&DriveTestVolume::CreateDriveIntegrationService, | 279 &DriveTestVolume::OnCreateDriveIntegrationService, |
280 base::Unretained(this))); | 280 this); |
281 return true; | 281 return true; |
282 } | 282 } |
283 | 283 |
| 284 static drive::DriveIntegrationService* OnCreateDriveIntegrationService( |
| 285 Profile* profile, void* data) { |
| 286 DriveTestVolume* self = static_cast<DriveTestVolume*>(data); |
| 287 return self->CreateDriveIntegrationService(profile); |
| 288 } |
| 289 |
284 void CreateEntry(const TestEntryInfo& entry) { | 290 void CreateEntry(const TestEntryInfo& entry) { |
285 const base::FilePath path = | 291 const base::FilePath path = |
286 base::FilePath::FromUTF8Unsafe(entry.target_path); | 292 base::FilePath::FromUTF8Unsafe(entry.target_path); |
287 const std::string target_name = path.BaseName().AsUTF8Unsafe(); | 293 const std::string target_name = path.BaseName().AsUTF8Unsafe(); |
288 | 294 |
289 // Obtain the parent entry. | 295 // Obtain the parent entry. |
290 drive::FileError error = drive::FILE_ERROR_OK; | 296 drive::FileError error = drive::FILE_ERROR_OK; |
291 scoped_ptr<drive::ResourceEntry> parent_entry(new drive::ResourceEntry); | 297 scoped_ptr<drive::ResourceEntry> parent_entry(new drive::ResourceEntry); |
292 integration_service_->file_system()->GetResourceEntry( | 298 integration_service_->file_system()->GetResourceEntry( |
293 drive::util::GetDriveMyDriveRootPath().Append(path).DirName(), | 299 drive::util::GetDriveMyDriveRootPath().Append(path).DirName(), |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "searchBoxFocus"))); | 747 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "searchBoxFocus"))); |
742 | 748 |
743 INSTANTIATE_TEST_CASE_P( | 749 INSTANTIATE_TEST_CASE_P( |
744 Thumbnails, | 750 Thumbnails, |
745 FileManagerBrowserTest, | 751 FileManagerBrowserTest, |
746 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "thumbnailsDownloads"), | 752 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "thumbnailsDownloads"), |
747 TestParameter(IN_GUEST_MODE, "thumbnailsDownloads"))); | 753 TestParameter(IN_GUEST_MODE, "thumbnailsDownloads"))); |
748 | 754 |
749 } // namespace | 755 } // namespace |
750 } // namespace file_manager | 756 } // namespace file_manager |
OLD | NEW |