| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/power/extension_event_observer.h" | 5 #include "chrome/browser/chromeos/power/extension_event_observer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // ::testing::Test overrides. | 61 // ::testing::Test overrides. |
| 62 void SetUp() override { | 62 void SetUp() override { |
| 63 ::testing::Test::SetUp(); | 63 ::testing::Test::SetUp(); |
| 64 | 64 |
| 65 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); | 65 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); |
| 66 | 66 |
| 67 // Must be called from ::testing::Test::SetUp. | 67 // Must be called from ::testing::Test::SetUp. |
| 68 ASSERT_TRUE(profile_manager_->SetUp()); | 68 ASSERT_TRUE(profile_manager_->SetUp()); |
| 69 | 69 |
| 70 const char kUserProfile[] = "profile1@example.com"; | 70 const char kUserProfile[] = "profile1@example.com"; |
| 71 fake_user_manager_->AddUser(kUserProfile); | 71 const AccountId account_id(AccountId::FromUserEmail(kUserProfile)); |
| 72 fake_user_manager_->LoginUser(kUserProfile); | 72 fake_user_manager_->AddUser(account_id); |
| 73 profile_ = profile_manager_->CreateTestingProfile(kUserProfile); | 73 fake_user_manager_->LoginUser(account_id); |
| 74 profile_ = |
| 75 profile_manager_->CreateTestingProfile(account_id.GetUserEmail()); |
| 74 | 76 |
| 75 profile_manager_->SetLoggedIn(true); | 77 profile_manager_->SetLoggedIn(true); |
| 76 } | 78 } |
| 77 void TearDown() override { | 79 void TearDown() override { |
| 78 profile_ = NULL; | 80 profile_ = NULL; |
| 79 profile_manager_->DeleteAllTestingProfiles(); | 81 profile_manager_->DeleteAllTestingProfiles(); |
| 80 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, nullptr); | 82 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, nullptr); |
| 81 ::testing::Test::TearDown(); | 83 ::testing::Test::TearDown(); |
| 82 } | 84 } |
| 83 | 85 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 EXPECT_FALSE(test_api_->MaybeRunSuspendReadinessCallback()); | 319 EXPECT_FALSE(test_api_->MaybeRunSuspendReadinessCallback()); |
| 318 EXPECT_EQ(0, power_manager_client_->GetNumPendingSuspendReadinessCallbacks()); | 320 EXPECT_EQ(0, power_manager_client_->GetNumPendingSuspendReadinessCallbacks()); |
| 319 | 321 |
| 320 // Test that the ExtensionEventObserver does not delay suspend attempts when | 322 // Test that the ExtensionEventObserver does not delay suspend attempts when |
| 321 // it is disabled. | 323 // it is disabled. |
| 322 power_manager_client_->SendDarkSuspendImminent(); | 324 power_manager_client_->SendDarkSuspendImminent(); |
| 323 EXPECT_EQ(0, power_manager_client_->GetNumPendingSuspendReadinessCallbacks()); | 325 EXPECT_EQ(0, power_manager_client_->GetNumPendingSuspendReadinessCallbacks()); |
| 324 } | 326 } |
| 325 | 327 |
| 326 } // namespace chromeos | 328 } // namespace chromeos |
| OLD | NEW |