| 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 "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "ash/system/date/date_default_view.h" | 6 #include "ash/system/date/date_default_view.h" |
| 7 #include "ash/system/date/date_view.h" | 7 #include "ash/system/date/date_view.h" |
| 8 #include "ash/system/user/login_status.h" | 8 #include "ash/system/user/login_status.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 15 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 13 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 16 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
| 14 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 17 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 15 #include "chrome/browser/chromeos/settings/cros_settings.h" | 18 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 16 #include "chrome/browser/lifetime/application_lifetime.h" | 19 #include "chrome/browser/lifetime/application_lifetime.h" |
| 17 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | 20 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 18 #include "chromeos/chromeos_switches.h" | 21 #include "chromeos/chromeos_switches.h" |
| 19 #include "content/public/test/test_utils.h" | 22 #include "content/public/test/test_utils.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 24 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 36 | 39 |
| 37 void SetUpInProcessBrowserTestFixture() override { | 40 void SetUpInProcessBrowserTestFixture() override { |
| 38 InstallOwnerKey(); | 41 InstallOwnerKey(); |
| 39 MarkAsEnterpriseOwned(); | 42 MarkAsEnterpriseOwned(); |
| 40 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); | 43 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 41 } | 44 } |
| 42 | 45 |
| 43 void TearDownOnMainThread() override { | 46 void TearDownOnMainThread() override { |
| 44 // If the login display is still showing, exit gracefully. | 47 // If the login display is still showing, exit gracefully. |
| 45 if (LoginDisplayHost::default_host()) { | 48 if (LoginDisplayHost::default_host()) { |
| 46 base::MessageLoop::current()->PostTask(FROM_HERE, | 49 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 47 base::Bind(&chrome::AttemptExit)); | 50 FROM_HERE, base::Bind(&chrome::AttemptExit)); |
| 48 content::RunMessageLoop(); | 51 content::RunMessageLoop(); |
| 49 } | 52 } |
| 50 } | 53 } |
| 51 | 54 |
| 52 protected: | 55 protected: |
| 53 void RefreshPolicyAndWaitDeviceSettingsUpdated() { | 56 void RefreshPolicyAndWaitDeviceSettingsUpdated() { |
| 54 std::unique_ptr<CrosSettings::ObserverSubscription> observer = | 57 std::unique_ptr<CrosSettings::ObserverSubscription> observer = |
| 55 CrosSettings::Get()->AddSettingsObserver( | 58 CrosSettings::Get()->AddSettingsObserver( |
| 56 kSystemUse24HourClock, | 59 kSystemUse24HourClock, |
| 57 base::MessageLoop::current()->QuitWhenIdleClosure()); | 60 base::MessageLoop::current()->QuitWhenIdleClosure()); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 EXPECT_TRUE(CrosSettings::Get()->GetBoolean(kSystemUse24HourClock, | 167 EXPECT_TRUE(CrosSettings::Get()->GetBoolean(kSystemUse24HourClock, |
| 165 &system_use_24hour_clock)); | 168 &system_use_24hour_clock)); |
| 166 EXPECT_FALSE(system_use_24hour_clock); | 169 EXPECT_FALSE(system_use_24hour_clock); |
| 167 EXPECT_FALSE(GetSystemTrayDelegateShouldUse24HourClock()); | 170 EXPECT_FALSE(GetSystemTrayDelegateShouldUse24HourClock()); |
| 168 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayTimeHourType()); | 171 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayTimeHourType()); |
| 169 EXPECT_TRUE(TestPrimarySystemTrayHasDateDefaultView()); | 172 EXPECT_TRUE(TestPrimarySystemTrayHasDateDefaultView()); |
| 170 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayDateHourType()); | 173 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayDateHourType()); |
| 171 } | 174 } |
| 172 | 175 |
| 173 } // namespace chromeos | 176 } // namespace chromeos |
| OLD | NEW |