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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_throttler_unittest.cc

Issue 707113002: Plugin Power Saver: Refactor Plugin Instance Throttling code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0190-plugin-power-saver-add-some-umas
Patch Set: Created 6 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/bind.h"
6 #include "base/logging.h"
7 #include "content/renderer/pepper/pepper_plugin_instance_throttler.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace content {
11
12 namespace {
13
14 class TestPepperPluginInstanceThrottler : public PepperPluginInstanceThrottler {
15 public:
16 TestPepperPluginInstanceThrottler(bool power_saver_enabled,
17 bool is_peripheral_content)
18 : PepperPluginInstanceThrottler(
19 base::Bind(&TestPepperPluginInstanceThrottler::ChangeCallback,
20 base::Unretained(this)),
21 power_saver_enabled,
22 is_peripheral_content),
23 change_callback_calls_(0) {
24 }
25
26 int change_callback_calls() { return change_callback_calls_; }
27
28 private:
29 void ChangeCallback() {
30 ++change_callback_calls_;
31 }
32
33 int change_callback_calls_;
34 };
35
36 } // namespace
37
38 TEST(PepperPluginInstanceThrottlerTest, ThrottleAndUnthrottle) {
39 TestPepperPluginInstanceThrottler throttler(true /* power_saver_enabled */,
40 true /* is_perpheral_content */);
41 EXPECT_FALSE(throttler.is_throttled());
42
43 }
44
45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698