| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 mount_point_path, file_manager::VOLUME_TYPE_TESTING, | 258 mount_point_path, file_manager::VOLUME_TYPE_TESTING, |
| 259 chromeos::DEVICE_TYPE_UNKNOWN, read_only); | 259 chromeos::DEVICE_TYPE_UNKNOWN, read_only); |
| 260 } | 260 } |
| 261 | 261 |
| 262 // Simulates entering the kiosk session. | 262 // Simulates entering the kiosk session. |
| 263 void EnterKioskSession() { | 263 void EnterKioskSession() { |
| 264 fake_user_manager_ = new chromeos::FakeChromeUserManager(); | 264 fake_user_manager_ = new chromeos::FakeChromeUserManager(); |
| 265 user_manager_enabler_.reset( | 265 user_manager_enabler_.reset( |
| 266 new chromeos::ScopedUserManagerEnabler(fake_user_manager_)); | 266 new chromeos::ScopedUserManagerEnabler(fake_user_manager_)); |
| 267 | 267 |
| 268 const std::string kKioskLogin = "kiosk@foobar.com"; | 268 const AccountId kiosk_app_account_id = |
| 269 fake_user_manager_->AddKioskAppUser(kKioskLogin); | 269 AccountId::FromUserEmail("kiosk@foobar.com"); |
| 270 fake_user_manager_->LoginUser(kKioskLogin); | 270 fake_user_manager_->AddKioskAppUser(kiosk_app_account_id); |
| 271 fake_user_manager_->LoginUser(kiosk_app_account_id); |
| 271 } | 272 } |
| 272 }; | 273 }; |
| 273 | 274 |
| 274 IN_PROC_BROWSER_TEST_F(FileSystemApiTestForDrive, | 275 IN_PROC_BROWSER_TEST_F(FileSystemApiTestForDrive, |
| 275 FileSystemApiOpenExistingFileTest) { | 276 FileSystemApiOpenExistingFileTest) { |
| 276 base::FilePath test_file = drive::util::GetDriveMountPointPath( | 277 base::FilePath test_file = drive::util::GetDriveMountPointPath( |
| 277 browser()->profile()).AppendASCII("root/open_existing.txt"); | 278 browser()->profile()).AppendASCII("root/open_existing.txt"); |
| 278 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 279 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
| 279 &test_file); | 280 &test_file); |
| 280 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/open_existing")) | 281 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/open_existing")) |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 profile(), extensions::api::file_system::OnVolumeListChanged::kEventName, | 492 profile(), extensions::api::file_system::OnVolumeListChanged::kEventName, |
| 492 kTestingExtensionId, | 493 kTestingExtensionId, |
| 493 base::Bind(&FileSystemApiTestForRequestFileSystem::MountFakeVolume, | 494 base::Bind(&FileSystemApiTestForRequestFileSystem::MountFakeVolume, |
| 494 this)); | 495 this)); |
| 495 | 496 |
| 496 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/on_volume_list_changed")) | 497 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/on_volume_list_changed")) |
| 497 << message_; | 498 << message_; |
| 498 } | 499 } |
| 499 | 500 |
| 500 } // namespace extensions | 501 } // namespace extensions |
| OLD | NEW |