| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/message_loop/message_loop.h" | |
| 14 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "base/values.h" | 16 #include "base/values.h" |
| 16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 17 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 17 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 18 #include "chrome/browser/chromeos/policy/device_policy_builder.h" | 19 #include "chrome/browser/chromeos/policy/device_policy_builder.h" |
| 19 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 20 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
| 20 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 21 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 21 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 22 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 22 #include "chrome/browser/lifetime/application_lifetime.h" | 23 #include "chrome/browser/lifetime/application_lifetime.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 chromeos::ProfileHelper::GetSigninProfile()); | 184 chromeos::ProfileHelper::GetSigninProfile()); |
| 184 | 185 |
| 185 chromeos::MagnificationManager* magnification_manager = | 186 chromeos::MagnificationManager* magnification_manager = |
| 186 chromeos::MagnificationManager::Get(); | 187 chromeos::MagnificationManager::Get(); |
| 187 ASSERT_TRUE(magnification_manager); | 188 ASSERT_TRUE(magnification_manager); |
| 188 magnification_manager->SetProfileForTest( | 189 magnification_manager->SetProfileForTest( |
| 189 chromeos::ProfileHelper::GetSigninProfile()); | 190 chromeos::ProfileHelper::GetSigninProfile()); |
| 190 } | 191 } |
| 191 | 192 |
| 192 void LoginScreenDefaultPolicyLoginScreenBrowsertest::TearDownOnMainThread() { | 193 void LoginScreenDefaultPolicyLoginScreenBrowsertest::TearDownOnMainThread() { |
| 193 base::MessageLoop::current()->PostTask(FROM_HERE, | 194 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 194 base::Bind(&chrome::AttemptExit)); | 195 FROM_HERE, base::Bind(&chrome::AttemptExit)); |
| 195 base::RunLoop().RunUntilIdle(); | 196 base::RunLoop().RunUntilIdle(); |
| 196 LoginScreenDefaultPolicyBrowsertestBase::TearDownOnMainThread(); | 197 LoginScreenDefaultPolicyBrowsertestBase::TearDownOnMainThread(); |
| 197 } | 198 } |
| 198 | 199 |
| 199 void LoginScreenDefaultPolicyLoginScreenBrowsertest:: | 200 void LoginScreenDefaultPolicyLoginScreenBrowsertest:: |
| 200 VerifyPrefFollowsRecommendation(const char* pref_name, | 201 VerifyPrefFollowsRecommendation(const char* pref_name, |
| 201 const base::Value& recommended_value) { | 202 const base::Value& recommended_value) { |
| 202 const PrefService::Preference* pref = | 203 const PrefService::Preference* pref = |
| 203 login_profile_->GetPrefs()->FindPreference(pref_name); | 204 login_profile_->GetPrefs()->FindPreference(pref_name); |
| 204 ASSERT_TRUE(pref); | 205 ASSERT_TRUE(pref); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 base::FundamentalValue(true)); | 458 base::FundamentalValue(true)); |
| 458 | 459 |
| 459 // Verify that the on-screen keyboard is enabled. | 460 // Verify that the on-screen keyboard is enabled. |
| 460 chromeos::AccessibilityManager* accessibility_manager = | 461 chromeos::AccessibilityManager* accessibility_manager = |
| 461 chromeos::AccessibilityManager::Get(); | 462 chromeos::AccessibilityManager::Get(); |
| 462 ASSERT_TRUE(accessibility_manager); | 463 ASSERT_TRUE(accessibility_manager); |
| 463 EXPECT_TRUE(accessibility_manager->IsVirtualKeyboardEnabled()); | 464 EXPECT_TRUE(accessibility_manager->IsVirtualKeyboardEnabled()); |
| 464 } | 465 } |
| 465 | 466 |
| 466 } // namespace policy | 467 } // namespace policy |
| OLD | NEW |