Bug 1322746 - dom/base/test/test_anonymousContent_canvas.html should not assume webgl works. - r=daoshengmu

MozReview-Commit-ID: 7oEK4pWMCdc
This commit is contained in:
Jeff Gilbert 2017-08-23 01:05:11 -07:00
parent 095dd0afd8
commit 49590d9286

View File

@ -43,14 +43,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1212477
"Get a context using unexisting id should throw"
);
let webgl = anonymousContent.getCanvasContext("canvas-webgl", "webgl");
const normalWebGL = document.createElement('canvas').getContext('webgl');
if (normalWebGL) {
let webgl = anonymousContent.getCanvasContext("canvas-webgl", "webgl");
is(webgl.toString(), "[object WebGLRenderingContext]",
"WebGL Context is returned properly");
is(webgl.canvas, null,
"WebGL context's canvas property is null in anonymous content");
is(webgl.toString(), "[object WebGLRenderingContext]",
"WebGL Context is returned properly");
is(webgl.canvas, null,
"WebGL context's canvas property is null in anonymous content");
}
chromeDocument.removeAnonymousContent(anonymousContent);
</script>
</body>