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

Side by Side Diff: powerd_unittest.cc

Issue 2689004: Convert 'char *' to 'char*' throughout power manager. (Closed) Base URL: ssh://git@chromiumos-git/power_manager.git
Patch Set: Created 10 years, 6 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
« powerd.cc ('K') | « powerd.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 #include <gdk/gdk.h> 6 #include <gdk/gdk.h>
7 #include <gdk/gdkx.h> 7 #include <gdk/gdkx.h>
8 #include <X11/extensions/XTest.h> 8 #include <X11/extensions/XTest.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 ExpectMetric("Dummy.MetricOnBattery", 3, 1, 100, 50); 330 ExpectMetric("Dummy.MetricOnBattery", 3, 1, 100, 50);
331 EXPECT_TRUE(daemon_.SendMetricWithPowerState("Dummy.Metric", /* sample */ 3, 331 EXPECT_TRUE(daemon_.SendMetricWithPowerState("Dummy.Metric", /* sample */ 3,
332 /* min */ 1, /* max */ 100, /* buckets */ 50)); 332 /* min */ 1, /* max */ 100, /* buckets */ 50));
333 daemon_.plugged_state_ = daemon_.kPowerConnected; 333 daemon_.plugged_state_ = daemon_.kPowerConnected;
334 ExpectMetric("Dummy.MetricOnAC", 3, 1, 100, 50); 334 ExpectMetric("Dummy.MetricOnAC", 3, 1, 100, 50);
335 EXPECT_TRUE(daemon_.SendMetricWithPowerState("Dummy.Metric", /* sample */ 3, 335 EXPECT_TRUE(daemon_.SendMetricWithPowerState("Dummy.Metric", /* sample */ 3,
336 /* min */ 1, /* max */ 100, /* buckets */ 50)); 336 /* min */ 1, /* max */ 100, /* buckets */ 50));
337 } 337 }
338 338
339 static gboolean QuitLoop(gpointer data) { 339 static gboolean QuitLoop(gpointer data) {
340 GMainLoop *loop = static_cast<GMainLoop*>(data); 340 GMainLoop* loop = static_cast<GMainLoop*>(data);
341 g_main_loop_quit(loop); 341 g_main_loop_quit(loop);
342 return false; 342 return false;
343 } 343 }
344 344
345 TEST_F(DaemonTest, GenerateMetricsOnIdleEvent) { 345 TEST_F(DaemonTest, GenerateMetricsOnIdleEvent) {
346 { 346 {
347 InSequence metrics; 347 InSequence metrics;
348 EXPECT_CALL(backlight_, SetBrightness(kUnpluggedBrightness)) 348 EXPECT_CALL(backlight_, SetBrightness(kUnpluggedBrightness))
349 .WillOnce(Return(true)); 349 .WillOnce(Return(true));
350 EXPECT_CALL(backlight_, GetBrightness(NotNull(), NotNull())) 350 EXPECT_CALL(backlight_, GetBrightness(NotNull(), NotNull()))
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 EXPECT_CALL(backlight_, GetBrightness(NotNull(), NotNull())) 442 EXPECT_CALL(backlight_, GetBrightness(NotNull(), NotNull()))
443 .WillOnce(DoAll(SetArgumentPointee<0>(kDefaultBrightness), 443 .WillOnce(DoAll(SetArgumentPointee<0>(kDefaultBrightness),
444 SetArgumentPointee<1>(kMaxBrightness), 444 SetArgumentPointee<1>(kMaxBrightness),
445 Return(true))); 445 Return(true)));
446 ExpectEnumMetric("Power.BacklightLevelOnAC", 446 ExpectEnumMetric("Power.BacklightLevelOnAC",
447 kDefaultBrightness, kMaxBrightness); 447 kDefaultBrightness, kMaxBrightness);
448 daemon_.GenerateBacklightLevelMetric(&daemon_); 448 daemon_.GenerateBacklightLevelMetric(&daemon_);
449 } 449 }
450 450
451 } // namespace power_manager 451 } // namespace power_manager
OLDNEW
« powerd.cc ('K') | « powerd.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698