| 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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "webkit/fileapi/file_system_context.h" | 8 #include "webkit/fileapi/file_system_context.h" |
| 9 #include "webkit/fileapi/file_system_mount_point_provider.h" | 9 #include "webkit/fileapi/file_system_mount_point_provider.h" |
| 10 | 10 |
| 11 using content::BrowserContext; |
| 12 |
| 11 #if defined(OS_CHROMEOS) | 13 #if defined(OS_CHROMEOS) |
| 12 | 14 |
| 13 class FileSystemExtensionApiTest : public ExtensionApiTest { | 15 class FileSystemExtensionApiTest : public ExtensionApiTest { |
| 14 public: | 16 public: |
| 15 FileSystemExtensionApiTest() : test_mount_point_("/tmp") { | 17 FileSystemExtensionApiTest() : test_mount_point_("/tmp") { |
| 16 } | 18 } |
| 17 | 19 |
| 18 virtual ~FileSystemExtensionApiTest() {} | 20 virtual ~FileSystemExtensionApiTest() {} |
| 19 | 21 |
| 20 // Sets up test environment | 22 // Sets up test environment |
| 21 void AddTmpMountPoint() { | 23 void AddTmpMountPoint() { |
| 22 // Add tmp mount point. | 24 // Add tmp mount point. |
| 23 fileapi::ExternalFileSystemMountPointProvider* provider = | 25 fileapi::ExternalFileSystemMountPointProvider* provider = |
| 24 browser()->profile()->GetFileSystemContext()->external_provider(); | 26 BrowserContext::GetFileSystemContext(browser()->profile())-> |
| 27 external_provider(); |
| 25 provider->AddMountPoint(test_mount_point_); | 28 provider->AddMountPoint(test_mount_point_); |
| 26 } | 29 } |
| 27 | 30 |
| 28 private: | 31 private: |
| 29 FilePath test_mount_point_; | 32 FilePath test_mount_point_; |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 IN_PROC_BROWSER_TEST_F(FileSystemExtensionApiTest, LocalFileSystem) { | 35 IN_PROC_BROWSER_TEST_F(FileSystemExtensionApiTest, LocalFileSystem) { |
| 33 AddTmpMountPoint(); | 36 AddTmpMountPoint(); |
| 34 ASSERT_TRUE(RunComponentExtensionTest("local_filesystem")) << message_; | 37 ASSERT_TRUE(RunComponentExtensionTest("local_filesystem")) << message_; |
| 35 | 38 |
| 36 } | 39 } |
| 37 | 40 |
| 38 IN_PROC_BROWSER_TEST_F(FileSystemExtensionApiTest, FileBrowserTest) { | 41 IN_PROC_BROWSER_TEST_F(FileSystemExtensionApiTest, FileBrowserTest) { |
| 39 AddTmpMountPoint(); | 42 AddTmpMountPoint(); |
| 40 ASSERT_TRUE(RunExtensionTest("filesystem_handler")) << message_; | 43 ASSERT_TRUE(RunExtensionTest("filesystem_handler")) << message_; |
| 41 ASSERT_TRUE(RunComponentExtensionTest("filebrowser_component")) << message_; | 44 ASSERT_TRUE(RunComponentExtensionTest("filebrowser_component")) << message_; |
| 42 } | 45 } |
| 43 | 46 |
| 44 #endif | 47 #endif |
| OLD | NEW |