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/chromeos/display/display_preferences.h" | 5 #include "chrome/browser/chromeos/display/display_preferences.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 class DisplayPreferencesTest : public ash::test::AshTestBase { | 44 class DisplayPreferencesTest : public ash::test::AshTestBase { |
45 protected: | 45 protected: |
46 DisplayPreferencesTest() | 46 DisplayPreferencesTest() |
47 : mock_user_manager_(new MockUserManager), | 47 : mock_user_manager_(new MockUserManager), |
48 user_manager_enabler_(mock_user_manager_) { | 48 user_manager_enabler_(mock_user_manager_) { |
49 } | 49 } |
50 | 50 |
51 virtual ~DisplayPreferencesTest() {} | 51 virtual ~DisplayPreferencesTest() {} |
52 | 52 |
53 virtual void SetUp() OVERRIDE { | 53 virtual void SetUp() override { |
54 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) | 54 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) |
55 .WillRepeatedly(testing::Return(false)); | 55 .WillRepeatedly(testing::Return(false)); |
56 EXPECT_CALL(*mock_user_manager_, Shutdown()); | 56 EXPECT_CALL(*mock_user_manager_, Shutdown()); |
57 ash::test::AshTestBase::SetUp(); | 57 ash::test::AshTestBase::SetUp(); |
58 RegisterDisplayLocalStatePrefs(local_state_.registry()); | 58 RegisterDisplayLocalStatePrefs(local_state_.registry()); |
59 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); | 59 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); |
60 observer_.reset(new DisplayConfigurationObserver()); | 60 observer_.reset(new DisplayConfigurationObserver()); |
61 } | 61 } |
62 | 62 |
63 virtual void TearDown() OVERRIDE { | 63 virtual void TearDown() override { |
64 observer_.reset(); | 64 observer_.reset(); |
65 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); | 65 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); |
66 ash::test::AshTestBase::TearDown(); | 66 ash::test::AshTestBase::TearDown(); |
67 } | 67 } |
68 | 68 |
69 void LoggedInAsUser() { | 69 void LoggedInAsUser() { |
70 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) | 70 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) |
71 .WillRepeatedly(testing::Return(true)); | 71 .WillRepeatedly(testing::Return(true)); |
72 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsRegularUser()) | 72 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsRegularUser()) |
73 .WillRepeatedly(testing::Return(true)); | 73 .WillRepeatedly(testing::Return(true)); |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 | 871 |
872 EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); | 872 EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); |
873 | 873 |
874 const base::DictionaryValue* properties = | 874 const base::DictionaryValue* properties = |
875 local_state()->GetDictionary(prefs::kDisplayRotationLock); | 875 local_state()->GetDictionary(prefs::kDisplayRotationLock); |
876 bool rotation_lock; | 876 bool rotation_lock; |
877 EXPECT_TRUE(properties->GetBoolean("lock", &rotation_lock)); | 877 EXPECT_TRUE(properties->GetBoolean("lock", &rotation_lock)); |
878 } | 878 } |
879 | 879 |
880 } // namespace chromeos | 880 } // namespace chromeos |
OLD | NEW |