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 <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
12 #include "chromeos/disks/mock_disk_mount_manager.h" | 12 #include "chromeos/disks/mock_disk_mount_manager.h" |
| 13 #include "content/public/browser/browser_context.h" |
13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/storage_partition.h" |
14 #include "webkit/fileapi/file_system_context.h" | 16 #include "webkit/fileapi/file_system_context.h" |
15 #include "webkit/fileapi/file_system_mount_point_provider.h" | 17 #include "webkit/fileapi/file_system_mount_point_provider.h" |
16 | 18 |
17 using ::testing::_; | 19 using ::testing::_; |
18 using ::testing::AnyNumber; | 20 using ::testing::AnyNumber; |
19 using ::testing::ReturnRef; | 21 using ::testing::ReturnRef; |
20 using ::testing::StrEq; | 22 using ::testing::StrEq; |
21 using content::BrowserContext; | 23 using content::BrowserContext; |
22 | 24 |
23 using chromeos::disks::DiskMountManager; | 25 using chromeos::disks::DiskMountManager; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // ExtensionApiTest override | 181 // ExtensionApiTest override |
180 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 182 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
181 chromeos::disks::DiskMountManager::Shutdown(); | 183 chromeos::disks::DiskMountManager::Shutdown(); |
182 disk_mount_manager_mock_ = NULL; | 184 disk_mount_manager_mock_ = NULL; |
183 | 185 |
184 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); | 186 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); |
185 } | 187 } |
186 | 188 |
187 void AddTmpMountPoint() { | 189 void AddTmpMountPoint() { |
188 fileapi::ExternalFileSystemMountPointProvider* provider = | 190 fileapi::ExternalFileSystemMountPointProvider* provider = |
189 BrowserContext::GetFileSystemContext(browser()->profile())-> | 191 BrowserContext::GetDefaultStoragePartition(browser()->profile())-> |
190 external_provider(); | 192 GetFileSystemContext()->external_provider(); |
191 provider->AddLocalMountPoint(test_mount_point_); | 193 provider->AddLocalMountPoint(test_mount_point_); |
192 } | 194 } |
193 | 195 |
194 private: | 196 private: |
195 void InitMountPoints() { | 197 void InitMountPoints() { |
196 for (size_t i = 0; i < arraysize(kTestMountPoints); i++) { | 198 for (size_t i = 0; i < arraysize(kTestMountPoints); i++) { |
197 mount_points_.insert(DiskMountManager::MountPointMap::value_type( | 199 mount_points_.insert(DiskMountManager::MountPointMap::value_type( |
198 kTestMountPoints[i].mount_path, | 200 kTestMountPoints[i].mount_path, |
199 DiskMountManager::MountPointInfo(kTestMountPoints[i].source_path, | 201 DiskMountManager::MountPointInfo(kTestMountPoints[i].source_path, |
200 kTestMountPoints[i].mount_path, | 202 kTestMountPoints[i].mount_path, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 UnmountPath(StrEq("/media/archive/archive_mount_path"))).Times(1); | 264 UnmountPath(StrEq("/media/archive/archive_mount_path"))).Times(1); |
263 | 265 |
264 EXPECT_CALL(*disk_mount_manager_mock_, disks()) | 266 EXPECT_CALL(*disk_mount_manager_mock_, disks()) |
265 .WillRepeatedly(ReturnRef(volumes_)); | 267 .WillRepeatedly(ReturnRef(volumes_)); |
266 | 268 |
267 EXPECT_CALL(*disk_mount_manager_mock_, mount_points()) | 269 EXPECT_CALL(*disk_mount_manager_mock_, mount_points()) |
268 .WillRepeatedly(ReturnRef(mount_points_)); | 270 .WillRepeatedly(ReturnRef(mount_points_)); |
269 | 271 |
270 ASSERT_TRUE(RunComponentExtensionTest("filebrowser_mount")) << message_; | 272 ASSERT_TRUE(RunComponentExtensionTest("filebrowser_mount")) << message_; |
271 } | 273 } |
OLD | NEW |