| 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 "extensions/browser/api/power/power_api.h" | 5 #include "extensions/browser/api/power/power_api.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 base::WeakPtrFactory<PowerSaveBlockerStubManager> weak_ptr_factory_; | 124 base::WeakPtrFactory<PowerSaveBlockerStubManager> weak_ptr_factory_; |
| 125 | 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerStubManager); | 126 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerStubManager); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace | 129 } // namespace |
| 130 | 130 |
| 131 class PowerApiTest : public ApiUnitTest { | 131 class PowerApiTest : public ApiUnitTest { |
| 132 public: | 132 public: |
| 133 virtual void SetUp() OVERRIDE { | 133 virtual void SetUp() override { |
| 134 ApiUnitTest::SetUp(); | 134 ApiUnitTest::SetUp(); |
| 135 manager_.reset(new PowerSaveBlockerStubManager(browser_context())); | 135 manager_.reset(new PowerSaveBlockerStubManager(browser_context())); |
| 136 } | 136 } |
| 137 | 137 |
| 138 virtual void TearDown() OVERRIDE { | 138 virtual void TearDown() override { |
| 139 manager_.reset(); | 139 manager_.reset(); |
| 140 ApiUnitTest::TearDown(); | 140 ApiUnitTest::TearDown(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 protected: | 143 protected: |
| 144 // Shorthand for PowerRequestKeepAwakeFunction and | 144 // Shorthand for PowerRequestKeepAwakeFunction and |
| 145 // PowerReleaseKeepAwakeFunction. | 145 // PowerReleaseKeepAwakeFunction. |
| 146 enum FunctionType { | 146 enum FunctionType { |
| 147 REQUEST, | 147 REQUEST, |
| 148 RELEASE, | 148 RELEASE, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 EXPECT_EQ(NONE, manager_->PopFirstRequest()); | 270 EXPECT_EQ(NONE, manager_->PopFirstRequest()); |
| 271 | 271 |
| 272 // Make the first extension block display-sleep again. | 272 // Make the first extension block display-sleep again. |
| 273 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension())); | 273 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension())); |
| 274 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest()); | 274 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest()); |
| 275 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest()); | 275 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest()); |
| 276 EXPECT_EQ(NONE, manager_->PopFirstRequest()); | 276 EXPECT_EQ(NONE, manager_->PopFirstRequest()); |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace extensions | 279 } // namespace extensions |
| OLD | NEW |