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

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

Issue 356833006: Remove navigator.connection.type from some window tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 5 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() 1 function collectProperties()
2 { 2 {
3 // Collect properties of the top-level window, since touching the properties 3 // Collect properties of the top-level window, since touching the properties
4 // of a DOMWindow affects its internal C++ state. 4 // of a DOMWindow affects its internal C++ state.
5 collectPropertiesHelper(window, []); 5 collectPropertiesHelper(window, []);
6 6
7 propertiesToVerify.sort(function (a, b) 7 propertiesToVerify.sort(function (a, b)
8 { 8 {
9 if (a.property < b.property) 9 if (a.property < b.property)
10 return -1 10 return -1
(...skipping 25 matching lines...) Expand all
36 // no way of knowing when it's detached. Eventually this should have the sam e behavior. 36 // no way of knowing when it's detached. Eventually this should have the sam e behavior.
37 if (path.length >= 2 && (path[0] == 'console' || path[0] == 'performance') & & path[1] == 'memory') 37 if (path.length >= 2 && (path[0] == 'console' || path[0] == 'performance') & & path[1] == 'memory')
38 return; 38 return;
39 39
40 // Skip things that are assumed to be constants. 40 // Skip things that are assumed to be constants.
41 if (path[path.length - 1].toUpperCase() == path[path.length - 1]) 41 if (path[path.length - 1].toUpperCase() == path[path.length - 1])
42 return; 42 return;
43 43
44 // Various special cases for legacy reasons. Please do not add entries to th is list. 44 // Various special cases for legacy reasons. Please do not add entries to th is list.
45 var propertyPath = path.join('.'); 45 var propertyPath = path.join('.');
46
47 // Connection type depends on the host, skip.
48 if (propertyPath == 'navigator.connection.type')
49 return;
50
46 switch (propertyPath) { 51 switch (propertyPath) {
47 case "location.href": 52 case "location.href":
48 expected = "'about:blank'"; 53 expected = "'about:blank'";
49 break; 54 break;
50 case "location.origin": 55 case "location.origin":
51 expected = "'null'"; 56 expected = "'null'";
52 break; 57 break;
53 case "location.pathname": 58 case "location.pathname":
54 expected = "'blank'"; 59 expected = "'blank'";
55 break; 60 break;
56 case "location.protocol": 61 case "location.protocol":
57 expected = "'about:'"; 62 expected = "'about:'";
58 break; 63 break;
59 case "navigator.appCodeName": 64 case "navigator.appCodeName":
60 case "navigator.appName": 65 case "navigator.appName":
61 case "navigator.hardwareConcurrency": 66 case "navigator.hardwareConcurrency":
62 case "navigator.language": 67 case "navigator.language":
63 case "navigator.onLine": 68 case "navigator.onLine":
64 case "navigator.platform": 69 case "navigator.platform":
65 case "navigator.product": 70 case "navigator.product":
66 case "navigator.productSub": 71 case "navigator.productSub":
67 case "navigator.vendor": 72 case "navigator.vendor":
68 case "navigator.connection.type":
69 expected = "window." + propertyPath; 73 expected = "window." + propertyPath;
70 break; 74 break;
71 case "screen.orientation": 75 case "screen.orientation":
72 expected = "'portrait-primary'"; 76 expected = "'portrait-primary'";
73 break; 77 break;
74 } 78 }
75 79
76 insertExpectedResult(path, expected); 80 insertExpectedResult(path, expected);
77 } 81 }
78 82
(...skipping 18 matching lines...) Expand all
97 } else if (type == "string") { 101 } else if (type == "string") {
98 emitExpectedResult(path, "''"); 102 emitExpectedResult(path, "''");
99 } else if (type == "number") { 103 } else if (type == "number") {
100 emitExpectedResult(path, "0"); 104 emitExpectedResult(path, "0");
101 } else if (type == "boolean") { 105 } else if (type == "boolean") {
102 emitExpectedResult(path, "false"); 106 emitExpectedResult(path, "false");
103 } 107 }
104 path.pop(); 108 path.pop();
105 } 109 }
106 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698