| 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 "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 10 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 // Tests for a drive file system. | 285 // Tests for a drive file system. |
| 286 class DriveFileSystemExtensionApiTest : public FileSystemExtensionApiTestBase { | 286 class DriveFileSystemExtensionApiTest : public FileSystemExtensionApiTestBase { |
| 287 public: | 287 public: |
| 288 DriveFileSystemExtensionApiTest() : fake_drive_service_(NULL) {} | 288 DriveFileSystemExtensionApiTest() : fake_drive_service_(NULL) {} |
| 289 virtual ~DriveFileSystemExtensionApiTest() {} | 289 virtual ~DriveFileSystemExtensionApiTest() {} |
| 290 | 290 |
| 291 // FileSystemExtensionApiTestBase OVERRIDE. | 291 // FileSystemExtensionApiTestBase OVERRIDE. |
| 292 virtual void InitTestFileSystem() OVERRIDE { | 292 virtual void InitTestFileSystem() OVERRIDE { |
| 293 // Set up cache root and documents service to be used when creating gdata | 293 // Set up cache root to be used by DriveIntegrationService. This has to be |
| 294 // system service. This has to be done early on (before the browser is | 294 // done before the browser is created because the service instance is |
| 295 // created) because the system service instance is initialized very early | 295 // initialized by FileManagerEventRouter. |
| 296 // by FileManagerEventRouter. | |
| 297 ASSERT_TRUE(test_cache_root_.CreateUniqueTempDir()); | 296 ASSERT_TRUE(test_cache_root_.CreateUniqueTempDir()); |
| 298 | 297 |
| 299 drive::DriveIntegrationServiceFactory::SetFactoryForTest( | 298 drive::DriveIntegrationServiceFactory::SetFactoryForTest( |
| 300 base::Bind( | 299 base::Bind( |
| 301 &DriveFileSystemExtensionApiTest::CreateDriveIntegrationService, | 300 &DriveFileSystemExtensionApiTest::CreateDriveIntegrationService, |
| 302 base::Unretained(this))); | 301 base::Unretained(this))); |
| 303 } | 302 } |
| 304 | 303 |
| 305 // FileSystemExtensionApiTestBase OVERRIDE. | 304 // FileSystemExtensionApiTestBase OVERRIDE. |
| 306 virtual void AddTestMountPoint() OVERRIDE { | 305 virtual void AddTestMountPoint() OVERRIDE { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest, AppFileHandler) { | 424 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest, AppFileHandler) { |
| 426 fake_drive_service_->set_default_max_results(1); | 425 fake_drive_service_->set_default_max_results(1); |
| 427 EXPECT_TRUE(RunFileSystemExtensionApiTest( | 426 EXPECT_TRUE(RunFileSystemExtensionApiTest( |
| 428 "file_browser/handler_test_runner", | 427 "file_browser/handler_test_runner", |
| 429 FILE_PATH_LITERAL("manifest.json"), | 428 FILE_PATH_LITERAL("manifest.json"), |
| 430 "file_browser/app_file_handler", | 429 "file_browser/app_file_handler", |
| 431 FLAGS_USE_FILE_HANDLER)) << message_; | 430 FLAGS_USE_FILE_HANDLER)) << message_; |
| 432 } | 431 } |
| 433 | 432 |
| 434 } // namespace | 433 } // namespace |
| OLD | NEW |