Bug 676413 - test crossOrigin without value - r=bz

This commit is contained in:
Benoit Jacob 2011-08-10 18:25:22 -04:00
parent 47377bd040
commit 024236d717

View File

@ -35,8 +35,14 @@
function testTexture(url, crossOriginAttribute, expected_result) {
number_of_tests_live++;
var image = new Image();
if (crossOriginAttribute != "missing-value-default")
if (crossOriginAttribute == "just-crossOrigin-without-value") {
var div = document.createElement('div');
div.innerHTML="<img crossOrigin>";
image = div.children[0];
}
else if (crossOriginAttribute != "missing-value-default")
image.crossOrigin = crossOriginAttribute;
function testDone() {
number_of_tests_live--;
@ -77,20 +83,25 @@
return;
}
testTexture("http://mochi.test:8888/tests/content/canvas/test/webgl/crossorigin/image.png",
"missing-value-default",
OK);
testTexture("http://mochi.test:8888/tests/content/canvas/test/webgl/crossorigin/image.png",
"",
OK);
testTexture("http://mochi.test:8888/tests/content/canvas/test/webgl/crossorigin/image.png",
"just-crossOrigin-without-value",
OK);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image.png",
"missing-value-default",
SECURITY_ERR);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image.png",
"",
SECURITY_ERR);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image.png",
"just-crossOrigin-without-value",
SECURITY_ERR);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
"missing-value-default",
@ -98,6 +109,9 @@
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
"",
OK);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
"just-crossOrigin-without-value",
OK);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
"anonymous",
OK);
@ -111,6 +125,9 @@
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
"",
OK);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
"just-crossOrigin-without-value",
OK);
testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
"anonymous",
OK);