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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-property-collector.js

Issue 2863973003: Expose RTT and downlink bandwidth using experimental Javascript API (Closed)
Patch Set: kinuko 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 unified diff | Download patch
OLDNEW
1 function collectProperties(object, windowHasBeenGCed) 1 function collectProperties(object, windowHasBeenGCed)
2 { 2 {
3 collectPropertiesHelper(object, object, windowHasBeenGCed, []); 3 collectPropertiesHelper(object, object, windowHasBeenGCed, []);
4 4
5 propertiesToVerify.sort(function (a, b) 5 propertiesToVerify.sort(function (a, b)
6 { 6 {
7 if (a.property < b.property) 7 if (a.property < b.property)
8 return -1 8 return -1
9 if (a.property > b.property) 9 if (a.property > b.property)
10 return 1; 10 return 1;
(...skipping 28 matching lines...) Expand all
39 return; 39 return;
40 40
41 // Various special cases for legacy reasons. Please do not add entries to th is list. 41 // Various special cases for legacy reasons. Please do not add entries to th is list.
42 var propertyPath = path.join('.'); 42 var propertyPath = path.join('.');
43 43
44 // Connection type depends on the host, skip. 44 // Connection type depends on the host, skip.
45 if (propertyPath == 'navigator.connection.type') 45 if (propertyPath == 'navigator.connection.type')
46 return; 46 return;
47 if (propertyPath == 'navigator.connection.downlinkMax') 47 if (propertyPath == 'navigator.connection.downlinkMax')
48 return; 48 return;
49 if (propertyPath == 'navigator.connection.rtt')
50 return;
51 if (propertyPath == 'navigator.connection.downlink')
52 return;
49 53
50 switch (propertyPath) { 54 switch (propertyPath) {
51 case "location.href": 55 case "location.href":
52 expected = "'about:blank'"; 56 expected = "'about:blank'";
53 break; 57 break;
54 case "location.origin": 58 case "location.origin":
55 expected = "'null'"; 59 expected = "'null'";
56 break; 60 break;
57 case "origin": 61 case "origin":
58 expected = "'file://'"; 62 expected = "'file://'";
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 132 }
129 133
130 function pathExists(object, path) { 134 function pathExists(object, path) {
131 for (var i = 0; i < path.length; i++) { 135 for (var i = 0; i < path.length; i++) {
132 if (!object || !(path[i] in object)) 136 if (!object || !(path[i] in object))
133 return false; 137 return false;
134 object = object[path[i]]; 138 object = object[path[i]];
135 } 139 }
136 return true; 140 return true;
137 } 141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698