| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_, IsLoggedInAsUserWithGaiaAccount()) |
| 73 .WillRepeatedly(testing::Return(true)); | 73 .WillRepeatedly(testing::Return(true)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void LoggedInAsGuest() { | 76 void LoggedInAsGuest() { |
| 77 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) | 77 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) |
| 78 .WillRepeatedly(testing::Return(true)); | 78 .WillRepeatedly(testing::Return(true)); |
| 79 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsRegularUser()) | 79 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsUserWithGaiaAccount()) |
| 80 .WillRepeatedly(testing::Return(false)); | 80 .WillRepeatedly(testing::Return(false)); |
| 81 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsSupervisedUser()) | 81 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsSupervisedUser()) |
| 82 .WillRepeatedly(testing::Return(false)); | 82 .WillRepeatedly(testing::Return(false)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Do not use the implementation of display_preferences.cc directly to avoid | 85 // Do not use the implementation of display_preferences.cc directly to avoid |
| 86 // notifying the update to the system. | 86 // notifying the update to the system. |
| 87 void StoreDisplayLayoutPrefForName(const std::string& name, | 87 void StoreDisplayLayoutPrefForName(const std::string& name, |
| 88 ash::DisplayLayout::Position layout, | 88 ash::DisplayLayout::Position layout, |
| 89 int offset, | 89 int offset, |
| (...skipping 781 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 |