Chromium Code Reviews| 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 8b9816dac220a6047ec7d5b61f2c93675ea55411..aaaa144d24df424a4cc6946570f470562ff9bfdd 100644 |
| --- a/chrome/test/data/webui/net_internals/bandwidth_view.js |
| +++ b/chrome/test/data/webui/net_internals/bandwidth_view.js |
| @@ -59,7 +59,7 @@ BandwidthTask.prototype = { |
| assertEquals('string', typeof url); |
| this.url_ = url; |
| g_browser.addSessionNetworkStatsObserver(this, true); |
| - g_browser.addHistoricNetworkStatsObserver(this, false); |
| + g_browser.addHistoricNetworkStatsObserver(this, true); |
| NetInternalsTest.switchToView('bandwidth'); |
| chrome.send('loadPage', [this.url_]); |
| }, |
| @@ -116,7 +116,7 @@ BandwidthTask.prototype = { |
| * @param {object} networkStats State of the network session. |
| */ |
| onSessionNetworkStatsChanged: function(networkStats) { |
| - if (this.isDone() || this.sessionVerified) |
| + if (this.isDone()) |
| return; |
| // Wait until the received content length is at least the size of |
| // our test page and favicon. |
| @@ -137,15 +137,15 @@ BandwidthTask.prototype = { |
| * @param {object} networkStats State of the network session. |
| */ |
| onHistoricNetworkStatsChanged: function(networkStats) { |
| - if (this.isDone() || this.historicVerified) |
| + if (this.isDone()) |
| return; |
| - // The received content length should be zero since the historic |
| - // information only updates every hour. |
| - var expectedLength = 0; |
| - // Wait until the table has changed, otherwise the columns will be NaN |
| - if (!isNaN(this.getBandwidthTableCell_(0, 2))) { |
| + // 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. |
| + // Column 2 contains historic information, and it should be the same as |
| + // the session information, because previously there was no history. |
|
mmenke
2015/03/06 22:20:23
This assumption isn't necessarily true - remember
megjablon
2015/03/06 22:47:59
I simply reverted this test back to its state befo
mmenke
2015/03/09 16:00:21
That new text works for me.
megjablon
2015/03/09 20:15:40
Done.
|
| this.validateBandwidthTableColumn_(2, expectedLength, expectedLength); |
| this.historicVerified = true; |
| this.completeIfDone(); |