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

Unified Diff: chrome/test/data/webui/net_internals/bandwidth_view.js

Issue 473723002: Update data reduction proxy statistics prefs less often on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tooManyWritesPatch
Patch Set: Fixing net internals bandwidth page Created 6 years, 3 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: chrome/test/data/webui/net_internals/bandwidth_view.js
diff --git a/chrome/test/data/webui/net_internals/bandwidth_view.js b/chrome/test/data/webui/net_internals/bandwidth_view.js
index 5bbef70a992fee75d01a10307c8821a69b136e37..3b094ef61b5b398ac826b1429095aad96cfd6955 100644
--- a/chrome/test/data/webui/net_internals/bandwidth_view.js
+++ b/chrome/test/data/webui/net_internals/bandwidth_view.js
@@ -25,8 +25,7 @@ function BandwidthTask(expectedLength, faviconLength) {
this.url_ = null;
this.expectedLength_ = expectedLength;
this.faviconLength_ = faviconLength;
- this.sessionVerified = false;
- this.historicVerified = false;
+ this.verified = false;
}
BandwidthTask.prototype = {
@@ -42,7 +41,6 @@ BandwidthTask.prototype = {
assertEquals('string', typeof url);
this.url_ = url;
g_browser.addSessionNetworkStatsObserver(this, true);
- g_browser.addHistoricNetworkStatsObserver(this, true);
NetInternalsTest.switchToView('bandwidth');
chrome.send('loadPage', [this.url_]);
},
@@ -85,7 +83,7 @@ BandwidthTask.prototype = {
* verified to reflect the expected number of bytes received.
*/
completeIfDone: function() {
- if (this.historicVerified && this.sessionVerified) {
+ if (this.verified) {
// Check number of rows in the table.
NetInternalsTest.checkTbodyRows(BandwidthView.MAIN_BOX_ID, 4);
this.onTaskDone();
@@ -93,8 +91,9 @@ BandwidthTask.prototype = {
},
/**
- * SessionNetworkStatsObserver function. Sanity checks the received data
- * and constructed table.
+ * SessionNetworkStatsObserver function. The historic stats and session
+ * stats columns should be updated by the session stats change. Sanity
+ * checks the received data and constructed table.
* @param {object} networkStats State of the network session.
*/
@@ -108,29 +107,9 @@ BandwidthTask.prototype = {
expectLE(expectedLength, networkStats.session_original_content_length);
// Column 1 contains session information.
this.validateBandwidthTableColumn_(1, expectedLength, expectedLength);
- this.sessionVerified = true;
- this.completeIfDone();
- }
- },
-
- /**
- * HistoricNetworkStatsObserver function. Sanity checks the received data
- * and constructed table.
-
- * @param {object} networkStats State of the network session.
- */
- onHistoricNetworkStatsChanged: function(networkStats) {
- if (this.isDone())
- return;
- // Wait until the received content length is at least the size of
- // our test page and favicon.
- var expectedLength = this.expectedLength_ + this.faviconLength_;
- if (networkStats.historic_received_content_length >= expectedLength) {
- expectLE(expectedLength, networkStats.historic_original_content_length);
- // Column 2 contains historic information, and it should be the same as
- // the session information, because previously there was no history.
+ // Also check column 2, the historic information.
this.validateBandwidthTableColumn_(2, expectedLength, expectedLength);
- this.historicVerified = true;
+ this.verified = true;
this.completeIfDone();
mmenke 2014/09/15 15:11:02 Shouldn't onHistoricNetworkStatsChanged still be c
megjablon 2014/09/15 18:19:23 The test times out since it waits on the historic
mmenke 2014/09/16 14:18:45 Why can we rely on onSessionNetworkStatsChanged be
}
}

Powered by Google App Engine
This is Rietveld 408576698