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

Side by Side Diff: LayoutTests/fast/canvas/canvas-context-attributes-default-value.html

Issue 290143007: canvas.getContext with alpha:undefined should behave like alpha:true (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-context-attributes-default-value-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6
7 var checkAttributes = {
8 alpha : true,
9 };
10
11 function testAttributes(expectedAttributes, checkValue) {
12
13 if (arguments.length != 1 && arguments.length != 2)
14 return;
15
16 var canvas = document.createElement("canvas");
17 var initialAttributes = {};
18 var isUndefinedOrNull = arguments.length == 2 &&
19 (checkValue == undefined || checkValue == null);
20
21 if (isUndefinedOrNull)
22 for (key in expectedAttributes)
23 initialAttributes[key] = checkValue;
24
25 var context = canvas.getContext("2d", initialAttributes);
26
27 window.actualContextAttributes = context.getContextAttributes();
28
29 for (key in expectedAttributes)
30 shouldBe("actualContextAttributes." + key,
31 expectedAttributes[key].toString());
32 }
33
34 </script>
35 </head>
36 <body>
37 <script>
38
39 debug("Testing default value:");
40 testAttributes(checkAttributes);
41 debug("")
42
43 debug("Testing undefined value:");
44 testAttributes(checkAttributes, undefined);
45 debug("")
46
47 debug("Testing null value:");
48 testAttributes(checkAttributes, null);
49 debug("")
50
51 </script>
52 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-context-attributes-default-value-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698