Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / canvas-context-attributes-default-value.html
blobf23a5386bdb4eed9113967f5eeb84bfa48fe9e96
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
7 var trueAttributes = {
8 alpha : true,
9 };
11 var falseAttributes = {
12 alpha : false,
15 function testAttributes(expectedAttributes, checkValue) {
17 if (arguments.length != 1 && arguments.length != 2)
18 return;
20 var canvas = document.createElement("canvas");
21 var initialAttributes = {};
22 var isUndefinedOrNull = arguments.length == 2 &&
23 (checkValue == undefined || checkValue == null);
25 if (isUndefinedOrNull)
26 for (key in expectedAttributes)
27 initialAttributes[key] = checkValue;
29 var context = canvas.getContext("2d", initialAttributes);
31 window.actualContextAttributes = context.getContextAttributes();
33 for (key in expectedAttributes)
34 shouldBe("actualContextAttributes." + key,
35 expectedAttributes[key].toString());
38 </script>
39 </head>
40 <body>
41 <script>
43 debug("Testing default value:");
44 testAttributes(trueAttributes);
45 debug("")
47 debug("Testing undefined value:");
48 testAttributes(trueAttributes, undefined);
49 debug("")
51 debug("Testing null value:");
52 testAttributes(falseAttributes, null);
53 debug("")
55 </script>
56 </body>