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

Unified Diff: content/test/test_power_profiler_observer.cc

Issue 140583003: Chrome power profiler service (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/test/test_power_profiler_observer.cc
diff --git a/content/test/test_power_profiler_observer.cc b/content/test/test_power_profiler_observer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4537fcc1a092ee8a754bc35d03dc4a3e09cdfc2b
--- /dev/null
+++ b/content/test/test_power_profiler_observer.cc
@@ -0,0 +1,19 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/test/test_power_profiler_observer.h"
+
+namespace content {
+
+void TestPowerProfilerObserver::OnPowerEvent(const PowerEvent& event) {
+ if (IsValidEvent(event))
+ ++valid_event_count_;
+}
+
+bool TestPowerProfilerObserver::IsValidEvent(const PowerEvent& event) {
+ return event.type < PowerEvent::ID_COUNT && !event.time.is_null()
+ && event.value > 0;
+}
+
+} // namespace content
« content/test/test_power_data_provider.h ('K') | « content/test/test_power_profiler_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698