Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../../http/tests/inspector/elements-test.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 function test() | |
| 8 { | |
| 9 function getRandomInteger(min, max) { | |
| 10 return min + Math.floor(Math.random() * (max - min + 1)); | |
| 11 } | |
| 12 | |
| 13 function randomizeStringCase(str) | |
|
apavlov
2014/07/14 11:25:53
All tests must be deterministic, so this is not an
| |
| 14 { | |
| 15 var charIndicesForUpperCase = []; | |
| 16 for (var i = 0; i < str.length / 2; ++i) { | |
| 17 charIndicesForUpperCase.push(getRandomInteger(0, str.length)); | |
| 18 } | |
| 19 str = str.split(""); | |
| 20 for(i = 0; i < charIndicesForUpperCase.length; i++){ | |
| 21 if (charIndicesForUpperCase[i] < str.length) | |
| 22 str[charIndicesForUpperCase[i]] = str[charIndicesForUpperCase[i]].to UpperCase(); | |
| 23 } | |
| 24 return str.join(''); | |
| 25 } | |
| 26 | |
| 27 var colorAwareProperties = Object.keys(WebInspector.CSSMetadata._colorAwareP roperties); | |
| 28 for (var i = 0; i < colorAwareProperties.length; ++i) { | |
| 29 if (WebInspector.CSSMetadata.isColorAwareProperty(randomizeStringCase(co lorAwareProperties[i]))) | |
| 30 result = "PASS"; | |
| 31 else { | |
| 32 result = "FAIL"; | |
| 33 break; | |
| 34 } | |
| 35 } | |
| 36 InspectorTest.addResult("Result: " + result); | |
| 37 InspectorTest.completeTest(); | |
| 38 } | |
| 39 </script> | |
| 40 </head> | |
| 41 | |
| 42 <body onload="runTest()"> | |
| 43 <p> | |
| 44 Tests that color related mixed-cased CSS properties are really color aware. | |
| 45 </p> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |