OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 "remoting/protocol/fake_process_stats_stub.h" |
| 6 |
| 7 namespace remoting { |
| 8 namespace protocol { |
| 9 |
| 10 FakeProcessStatsStub::FakeProcessStatsStub() = default; |
| 11 FakeProcessStatsStub::~FakeProcessStatsStub() = default; |
| 12 |
| 13 void FakeProcessStatsStub::OnProcessStats( |
| 14 const AggregatedProcessResourceUsage& usage) { |
| 15 received_.push_back(usage); |
| 16 if (received_.size() == expected_usage_count_ && |
| 17 !quit_closure_.is_null()) { |
| 18 quit_closure_.Run(); |
| 19 } |
| 20 } |
| 21 |
| 22 const std::vector<AggregatedProcessResourceUsage>& |
| 23 FakeProcessStatsStub::received() const { |
| 24 return received_; |
| 25 } |
| 26 |
| 27 void FakeProcessStatsStub::set_quit_closure(base::Closure quit_closure) { |
| 28 quit_closure_ = quit_closure; |
| 29 } |
| 30 |
| 31 void FakeProcessStatsStub::set_expected_usage_count( |
| 32 size_t expected_usage_count) { |
| 33 expected_usage_count_ = expected_usage_count; |
| 34 } |
| 35 |
| 36 } // namespace protocol |
| 37 } // namespace remoting |
OLD | NEW |