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 "ash/system/chromeos/power/power_event_observer.h" | 5 #include "ash/system/chromeos/power/power_event_observer.h" |
6 | 6 |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
11 #include "chromeos/dbus/power_manager_client.h" | 11 #include "chromeos/dbus/power_manager_client.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 namespace internal { | |
15 | 14 |
16 class PowerEventObserverTest : public test::AshTestBase { | 15 class PowerEventObserverTest : public test::AshTestBase { |
17 public: | 16 public: |
18 PowerEventObserverTest() {} | 17 PowerEventObserverTest() {} |
19 virtual ~PowerEventObserverTest() {} | 18 virtual ~PowerEventObserverTest() {} |
20 | 19 |
21 // test::AshTestBase::SetUp() overrides: | 20 // test::AshTestBase::SetUp() overrides: |
22 virtual void SetUp() OVERRIDE { | 21 virtual void SetUp() OVERRIDE { |
23 test::AshTestBase::SetUp(); | 22 test::AshTestBase::SetUp(); |
24 observer_.reset(new PowerEventObserver()); | 23 observer_.reset(new PowerEventObserver()); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 EXPECT_EQ(0, client->GetNumPendingSuspendReadinessCallbacks()); | 60 EXPECT_EQ(0, client->GetNumPendingSuspendReadinessCallbacks()); |
62 | 61 |
63 // It also shouldn't request a callback if it isn't instructed to lock the | 62 // It also shouldn't request a callback if it isn't instructed to lock the |
64 // screen. | 63 // screen. |
65 observer_->SystemResumed(base::TimeDelta()); | 64 observer_->SystemResumed(base::TimeDelta()); |
66 SetShouldLockScreenBeforeSuspending(false); | 65 SetShouldLockScreenBeforeSuspending(false); |
67 observer_->SuspendImminent(); | 66 observer_->SuspendImminent(); |
68 EXPECT_EQ(0, client->GetNumPendingSuspendReadinessCallbacks()); | 67 EXPECT_EQ(0, client->GetNumPendingSuspendReadinessCallbacks()); |
69 } | 68 } |
70 | 69 |
71 } // namespace internal | |
72 } // namespace ash | 70 } // namespace ash |
OLD | NEW |