Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: extensions/browser/api/power/power_api_unittest.cc

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 29 matching lines...) Expand all
40 }; 40 };
41 41
42 // Stub implementation of content::PowerSaveBlocker that just runs a 42 // Stub implementation of content::PowerSaveBlocker that just runs a
43 // callback on destruction. 43 // callback on destruction.
44 class PowerSaveBlockerStub : public content::PowerSaveBlocker { 44 class PowerSaveBlockerStub : public content::PowerSaveBlocker {
45 public: 45 public:
46 explicit PowerSaveBlockerStub(base::Closure unblock_callback) 46 explicit PowerSaveBlockerStub(base::Closure unblock_callback)
47 : unblock_callback_(unblock_callback) { 47 : unblock_callback_(unblock_callback) {
48 } 48 }
49 49
50 virtual ~PowerSaveBlockerStub() { 50 ~PowerSaveBlockerStub() override { unblock_callback_.Run(); }
51 unblock_callback_.Run();
52 }
53 51
54 private: 52 private:
55 base::Closure unblock_callback_; 53 base::Closure unblock_callback_;
56 54
57 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerStub); 55 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerStub);
58 }; 56 };
59 57
60 // Manages PowerSaveBlockerStub objects. Tests can instantiate this class 58 // Manages PowerSaveBlockerStub objects. Tests can instantiate this class
61 // to make PowerApiManager's calls to create PowerSaveBlockers record the 59 // to make PowerApiManager's calls to create PowerSaveBlockers record the
62 // actions that would've been performed instead of actually blocking and 60 // actions that would've been performed instead of actually blocking and
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 EXPECT_EQ(NONE, manager_->PopFirstRequest()); 268 EXPECT_EQ(NONE, manager_->PopFirstRequest());
271 269
272 // Make the first extension block display-sleep again. 270 // Make the first extension block display-sleep again.
273 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension())); 271 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension()));
274 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest()); 272 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest());
275 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest()); 273 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest());
276 EXPECT_EQ(NONE, manager_->PopFirstRequest()); 274 EXPECT_EQ(NONE, manager_->PopFirstRequest());
277 } 275 }
278 276
279 } // namespace extensions 277 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/power/power_api_manager.h ('k') | extensions/browser/api/runtime/runtime_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698