OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 12 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
13 #include "chrome/browser/chromeos/drive/test_util.h" | |
14 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" | 13 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" |
15 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 14 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
16 #include "chrome/browser/chromeos/login/users/user_manager.h" | 15 #include "chrome/browser/chromeos/login/users/user_manager.h" |
17 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
18 #include "chrome/browser/drive/fake_drive_service.h" | 17 #include "chrome/browser/drive/fake_drive_service.h" |
19 #include "chrome/browser/extensions/extension_apitest.h" | 18 #include "chrome/browser/extensions/extension_apitest.h" |
20 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
22 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
23 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 | 569 |
571 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; | 570 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; |
572 scoped_ptr<google_apis::FileResource> entry; | 571 scoped_ptr<google_apis::FileResource> entry; |
573 | 572 |
574 // Place a hosted document under root/test_dir of the sub profile. | 573 // Place a hosted document under root/test_dir of the sub profile. |
575 sub_service->AddNewFileWithResourceId( | 574 sub_service->AddNewFileWithResourceId( |
576 kResourceId, | 575 kResourceId, |
577 "application/vnd.google-apps.document", "", | 576 "application/vnd.google-apps.document", "", |
578 resource_ids_["test_dir"], "hosted_doc", true, | 577 resource_ids_["test_dir"], "hosted_doc", true, |
579 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 578 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
580 drive::test_util::RunBlockingPoolTask(); | 579 content::RunAllBlockingPoolTasksUntilIdle(); |
581 if (error != google_apis::HTTP_CREATED) | 580 if (error != google_apis::HTTP_CREATED) |
582 return false; | 581 return false; |
583 | 582 |
584 // Place the hosted document with no parent in the main profile, for | 583 // Place the hosted document with no parent in the main profile, for |
585 // simulating the situation that the document is shared to the main profile. | 584 // simulating the situation that the document is shared to the main profile. |
586 error = google_apis::GDATA_OTHER_ERROR; | 585 error = google_apis::GDATA_OTHER_ERROR; |
587 main_service->AddNewFileWithResourceId( | 586 main_service->AddNewFileWithResourceId( |
588 kResourceId, | 587 kResourceId, |
589 "application/vnd.google-apps.document", "", "", "hosted_doc", true, | 588 "application/vnd.google-apps.document", "", "", "hosted_doc", true, |
590 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 589 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
591 drive::test_util::RunBlockingPoolTask(); | 590 content::RunAllBlockingPoolTasksUntilIdle(); |
592 return (error == google_apis::HTTP_CREATED); | 591 return (error == google_apis::HTTP_CREATED); |
593 } | 592 } |
594 | 593 |
595 DriveIntegrationServiceFactory::FactoryCallback | 594 DriveIntegrationServiceFactory::FactoryCallback |
596 create_drive_integration_service_; | 595 create_drive_integration_service_; |
597 scoped_ptr<DriveIntegrationServiceFactory::ScopedFactoryForTest> | 596 scoped_ptr<DriveIntegrationServiceFactory::ScopedFactoryForTest> |
598 service_factory_for_test_; | 597 service_factory_for_test_; |
599 Profile* second_profile; | 598 Profile* second_profile; |
600 std::map<std::string, std::string> resource_ids_; | 599 std::map<std::string, std::string> resource_ids_; |
601 }; | 600 }; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 AppFileHandlerMulti) { | 791 AppFileHandlerMulti) { |
793 EXPECT_TRUE( | 792 EXPECT_TRUE( |
794 RunFileSystemExtensionApiTest("file_browser/app_file_handler_multi", | 793 RunFileSystemExtensionApiTest("file_browser/app_file_handler_multi", |
795 FILE_PATH_LITERAL("manifest.json"), | 794 FILE_PATH_LITERAL("manifest.json"), |
796 "", | 795 "", |
797 FLAGS_NONE)) | 796 FLAGS_NONE)) |
798 << message_; | 797 << message_; |
799 } | 798 } |
800 } // namespace | 799 } // namespace |
801 } // namespace file_manager | 800 } // namespace file_manager |
OLD | NEW |