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

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

Issue 182613002: Add support to Battery Status API in blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add NeedsRebaseline for 4 tests for Mac. Created 6 years, 9 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 case "navigator.appCodeName": 46 case "navigator.appCodeName":
47 case "navigator.appName": 47 case "navigator.appName":
48 case "navigator.language": 48 case "navigator.language":
49 case "navigator.onLine": 49 case "navigator.onLine":
50 case "navigator.platform": 50 case "navigator.platform":
51 case "navigator.product": 51 case "navigator.product":
52 case "navigator.productSub": 52 case "navigator.productSub":
53 case "navigator.vendor": 53 case "navigator.vendor":
54 expected = "window." + propertyPath; 54 expected = "window." + propertyPath;
55 break; 55 break;
56 case "navigator.battery.charging":
57 expected = "true";
58 break;
59 case "navigator.battery.chargingTime":
60 expected = "Infinity";
61 break;
62 case "navigator.battery.dischargingTime":
63 expected = "Infinity";
64 break;
65 case "navigator.battery.level":
66 expected = "1";
67 break;
56 } 68 }
57 69
58 insertExpectedResult(path, expected); 70 insertExpectedResult(path, expected);
59 } 71 }
60 72
61 function collectPropertiesHelper(object, path) 73 function collectPropertiesHelper(object, path)
62 { 74 {
63 if (path.length > 20) 75 if (path.length > 20)
64 throw 'Error: probably looping'; 76 throw 'Error: probably looping';
65 77
(...skipping 18 matching lines...) Expand all
84 } else if (type == "string") { 96 } else if (type == "string") {
85 emitExpectedResult(path, "''"); 97 emitExpectedResult(path, "''");
86 } else if (type == "number") { 98 } else if (type == "number") {
87 emitExpectedResult(path, "0"); 99 emitExpectedResult(path, "0");
88 } else if (type == "boolean") { 100 } else if (type == "boolean") {
89 emitExpectedResult(path, "false"); 101 emitExpectedResult(path, "false");
90 } 102 }
91 path.pop(); 103 path.pop();
92 } 104 }
93 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698