Chromium Code Reviews| Index: LayoutTests/inspector/elements/styles/mixed-case-color-aware-properties.html |
| diff --git a/LayoutTests/inspector/elements/styles/mixed-case-color-aware-properties.html b/LayoutTests/inspector/elements/styles/mixed-case-color-aware-properties.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b7aada2e7fe2c497443647d8b1f3dd08988050d7 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/elements/styles/mixed-case-color-aware-properties.html |
| @@ -0,0 +1,47 @@ |
| +<html> |
| +<head> |
| +<script src="../../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../../http/tests/inspector/elements-test.js"></script> |
| +<script> |
| + |
| +function test() |
| +{ |
| + function getRandomInteger(min, max) { |
| + return min + Math.floor(Math.random() * (max - min + 1)); |
| + } |
| + |
| + function randomizeStringCase(str) |
|
apavlov
2014/07/14 11:25:53
All tests must be deterministic, so this is not an
|
| + { |
| + var charIndicesForUpperCase = []; |
| + for (var i = 0; i < str.length / 2; ++i) { |
| + charIndicesForUpperCase.push(getRandomInteger(0, str.length)); |
| + } |
| + str = str.split(""); |
| + for(i = 0; i < charIndicesForUpperCase.length; i++){ |
| + if (charIndicesForUpperCase[i] < str.length) |
| + str[charIndicesForUpperCase[i]] = str[charIndicesForUpperCase[i]].toUpperCase(); |
| + } |
| + return str.join(''); |
| + } |
| + |
| + var colorAwareProperties = Object.keys(WebInspector.CSSMetadata._colorAwareProperties); |
| + for (var i = 0; i < colorAwareProperties.length; ++i) { |
| + if (WebInspector.CSSMetadata.isColorAwareProperty(randomizeStringCase(colorAwareProperties[i]))) |
| + result = "PASS"; |
| + else { |
| + result = "FAIL"; |
| + break; |
| + } |
| + } |
| + InspectorTest.addResult("Result: " + result); |
| + InspectorTest.completeTest(); |
| +} |
| +</script> |
| +</head> |
| + |
| +<body onload="runTest()"> |
| +<p> |
| +Tests that color related mixed-cased CSS properties are really color aware. |
| +</p> |
| +</body> |
| +</html> |