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

Unified Diff: third_party/WebKit/LayoutTests/netinfo/estimate-web-worker.html

Issue 2903493002: NetInfo network quality extension: Add callbacks and Layout tests (Closed)
Patch Set: haraken comments Created 3 years, 7 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: third_party/WebKit/LayoutTests/netinfo/estimate-web-worker.html
diff --git a/third_party/WebKit/LayoutTests/netinfo/web-worker.html b/third_party/WebKit/LayoutTests/netinfo/estimate-web-worker.html
similarity index 51%
copy from third_party/WebKit/LayoutTests/netinfo/web-worker.html
copy to third_party/WebKit/LayoutTests/netinfo/estimate-web-worker.html
index cdb0c1d6325cc6da4eb6bc99c0f9ec91370aa23d..52a88a3e62061f7e9a05e26565a81b72ecbefa66 100644
--- a/third_party/WebKit/LayoutTests/netinfo/web-worker.html
+++ b/third_party/WebKit/LayoutTests/netinfo/estimate-web-worker.html
@@ -17,17 +17,19 @@ var msg_count = 0;
worker.addEventListener('message', function(e) {
if (msg_count == 0) {
- if (e.data != connection.type + ',' + connection.downlinkMax) {
+ if (e.data != connection.type + ',' + connection.downlinkMax + ',' + connection.effectiveType + ',' + connection.rtt + ',' + connection.downlink) {
testFailed("Worker type disagrees with main frame.");
}
- internals.setNetworkConnectionInfoOverride(isTypeOnline(newConnectionType), newConnectionType, newDownlinkMax);
+ internals.setNetworkQualityInfoOverride(newEffectiveType, newRtt, newDownlink);
} else if (msg_count == 1) {
- if (e.data != newConnectionType + ',' + newDownlinkMax)
- testFailed("Worker switched to wrong connection type.");
- internals.setNetworkConnectionInfoOverride(isTypeOnline(initialType), initialType, initialDownlinkMax);
+ if (e.data != connection.type + ',' + connection.downlinkMax + ',' + newEffectiveType + ',' + newRtt + ',' + newDownlink) {
+ testFailed("Worker switched to wrong quality estimate.");
+ }
+ internals.setNetworkQualityInfoOverride(initialEffectiveType, initialRtt, initialDownlink);
} else if (msg_count == 2) {
- if (e.data != initialType + ',' + initialDownlinkMax)
- testFailed("Worker did not revert back to initial type.");
+ if (e.data != connection.type + ',' + connection.downlinkMax + ',' + initialEffectiveType + ',' + initialRtt + ',' + initialDownlink) {
+ testFailed("Worker did not revert back to initial quality estimate.");
+ }
finishJSTest();
}
msg_count += 1;

Powered by Google App Engine
This is Rietveld 408576698