gecko-dev/dom/canvas/test/test_bug1215072.html

42 строки
1.2 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1215072
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1215072</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 1215072 **/
try {
var gl = document.createElement("canvas")
.getContext("webgl", { get stencil() { throw "bah (webgl)"; } });
ok(!gl, "Either should have thrown or not create a webgl context!");
} catch(ex) {
is(ex, "bah (webgl)", "Should have thrown an exception.");
}
try {
var c = document.createElement("canvas")
.getContext("2d", { get alpha() {throw "bah (2d)"; } });
ok(!c, "Either should have thrown or not create a 2d context!");
} catch(ex) {
is(ex, "bah (2d)", "Should have thrown an exception.");
}
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1215072">Mozilla Bug 1215072</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>