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

Unified Diff: remoting/host/process_stats_sender_unittest.cc

Issue 2964613002: [Chromoting] Deprecate AggregatedProcessResourceUsage.* (Closed)
Patch Set: Use latest ipc_message_protobuf_utils to serialize and deserialize AggregatedProcessResourceUsage Created 3 years, 5 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
« no previous file with comments | « remoting/host/process_stats_sender.cc ('k') | remoting/host/process_stats_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/process_stats_sender_unittest.cc
diff --git a/remoting/host/process_stats_sender_unittest.cc b/remoting/host/process_stats_sender_unittest.cc
index 6d08818c5343271c10557df58b0c051dd8bf6661..1a445f9e6417f880657ae8ff1d04d1e3600d3cab 100644
--- a/remoting/host/process_stats_sender_unittest.cc
+++ b/remoting/host/process_stats_sender_unittest.cc
@@ -73,21 +73,21 @@ class FakeProcessStatsAgent : public ProcessStatsAgent {
}
// Checks the expected usage based on index.
- static void AssertExpected(
- const protocol::AggregatedProcessResourceUsage& usage,
- size_t index) {
- ASSERT_EQ(usage.processor_usage(), index);
- ASSERT_EQ(usage.working_set_size(), index);
- ASSERT_EQ(usage.pagefile_size(), index);
- }
-
static void AssertExpected(const protocol::ProcessResourceUsage& usage,
size_t index) {
+ ASSERT_EQ(usage.process_name(), "FakeProcessStatsAgent");
ASSERT_EQ(usage.processor_usage(), index);
ASSERT_EQ(usage.working_set_size(), index);
ASSERT_EQ(usage.pagefile_size(), index);
}
+ static void AssertExpected(
+ const protocol::AggregatedProcessResourceUsage& usage,
+ size_t index) {
+ ASSERT_EQ(usage.usages_size(), 1);
+ AssertExpected(usage.usages().Get(0), index);
+ }
+
size_t issued_times() const { return index_; }
private:
@@ -169,7 +169,7 @@ TEST(ProcessStatsSenderTest, MergeUsage) {
ASSERT_EQ(stub.received().size(), 10U);
for (size_t i = 0; i < stub.received().size(); i++) {
- FakeProcessStatsAgent::AssertExpected(stub.received()[i], i * 2);
+ ASSERT_EQ(stub.received()[i].usages_size(), 2);
for (int j = 0; j < stub.received()[i].usages_size(); j++) {
FakeProcessStatsAgent::AssertExpected(
stub.received()[i].usages().Get(j), i);
« no previous file with comments | « remoting/host/process_stats_sender.cc ('k') | remoting/host/process_stats_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698