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

Unified Diff: net/nqe/network_quality_estimator_test_util.cc

Issue 2643213003: NQE: Add net log events when there is a significant change in metrics (Closed)
Patch Set: ryansturm comments Created 3 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
« no previous file with comments | « net/nqe/network_quality_estimator_test_util.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator_test_util.cc
diff --git a/net/nqe/network_quality_estimator_test_util.cc b/net/nqe/network_quality_estimator_test_util.cc
index e9c586ebe18c525be1afdfa2b20bee0c7196c151..000df14225ffccfba170e51488c6900dea732c38 100644
--- a/net/nqe/network_quality_estimator_test_util.cc
+++ b/net/nqe/network_quality_estimator_test_util.cc
@@ -212,6 +212,38 @@ int TestNetworkQualityEstimator::GetEntriesCount(NetLogEventType type) const {
return count;
}
+std::string TestNetworkQualityEstimator::GetNetLogLastStringValue(
+ NetLogEventType type,
+ const std::string& key) const {
+ std::string return_value;
+ TestNetLogEntry::List entries;
+ net_log_->GetEntries(&entries);
+
+ for (int i = entries.size() - 1; i >= 0; --i) {
+ if (entries[i].type == type &&
+ entries[i].GetStringValue(key, &return_value)) {
+ return return_value;
+ }
+ }
+ return return_value;
+}
+
+int TestNetworkQualityEstimator::GetNetLogLastIntegerValue(
+ NetLogEventType type,
+ const std::string& key) const {
+ int return_value = 0;
+ TestNetLogEntry::List entries;
+ net_log_->GetEntries(&entries);
+
+ for (int i = entries.size() - 1; i >= 0; --i) {
+ if (entries[i].type == type &&
+ entries[i].GetIntegerValue(key, &return_value)) {
+ return return_value;
+ }
+ }
+ return return_value;
+}
+
nqe::internal::NetworkID TestNetworkQualityEstimator::GetCurrentNetworkID()
const {
return nqe::internal::NetworkID(current_network_type_, current_network_id_);
« no previous file with comments | « net/nqe/network_quality_estimator_test_util.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698