| 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
|
|
|