Bug 1194848 - Make it possible to run fetch-canvas-tainting.https.html; r=jdm

This commit is contained in:
Ehsan Akhgari 2015-09-10 15:18:00 -04:00
parent 50b87b30dd
commit 4a192edc99
3 changed files with 27 additions and 27 deletions

View File

@ -1,6 +0,0 @@
[fetch-canvas-tainting.https.html]
type: testharness
expected: TIMEOUT
[Verify canvas tainting of fetched image in a Service Worker]
expected: TIMEOUT

View File

@ -11,7 +11,7 @@ async_test(function(t) {
var SCRIPT = 'resources/fetch-rewrite-worker.js';
var host_info = get_host_info();
login(t)
login_https(t)
.then(function() {
return service_worker_unregister_and_register(t, SCRIPT, SCOPE);
})
@ -28,7 +28,7 @@ async_test(function(t) {
service_worker_unregister_and_done(t, SCOPE);
});
frame.contentWindow.postMessage({},
host_info['HTTP_ORIGIN'],
host_info['HTTPS_ORIGIN'],
[channel.port2]);
});
})

View File

@ -51,8 +51,8 @@ function create_test_promise(url, cross_origin, expected_result) {
window.addEventListener('message', function(evt) {
var port = evt.ports[0];
var image_url = host_info['HTTP_ORIGIN'] + image_path;
var remote_image_url = host_info['HTTP_REMOTE_ORIGIN'] + image_path;
var image_url = host_info['HTTPS_ORIGIN'] + image_path;
var remote_image_url = host_info['HTTPS_REMOTE_ORIGIN'] + image_path;
Promise.all([
// Reject tests
create_test_promise(image_url + '&reject', '', LOAD_ERROR),
@ -73,7 +73,7 @@ window.addEventListener('message', function(evt) {
'anonymous',
LOAD_ERROR),
create_test_promise(
remote_image_url + '&ACAOrigin=' + host_info['HTTP_ORIGIN'] +
remote_image_url + '&ACAOrigin=' + host_info['HTTPS_ORIGIN'] +
'&ignore',
'anonymous',
NOT_TAINTED),
@ -82,12 +82,12 @@ window.addEventListener('message', function(evt) {
'use-credentials',
LOAD_ERROR),
create_test_promise(
remote_image_url + '&ACAOrigin=' + host_info['HTTP_ORIGIN'] +
remote_image_url + '&ACAOrigin=' + host_info['HTTPS_ORIGIN'] +
'&ignore',
'use-credentials',
LOAD_ERROR),
create_test_promise(
remote_image_url + '&ACAOrigin=' + host_info['HTTP_ORIGIN'] +
remote_image_url + '&ACAOrigin=' + host_info['HTTPS_ORIGIN'] +
'&ACACredentials=true&ignore',
'use-credentials',
NOT_TAINTED),
@ -110,12 +110,12 @@ window.addEventListener('message', function(evt) {
'use-credentials',
LOAD_ERROR),
create_test_promise(
remote_image_url + '&Auth&ACAOrigin=' + host_info['HTTP_ORIGIN'] +
remote_image_url + '&Auth&ACAOrigin=' + host_info['HTTPS_ORIGIN'] +
'&ignore',
'use-credentials',
LOAD_ERROR),
create_test_promise(
remote_image_url + '&Auth&ACAOrigin=' + host_info['HTTP_ORIGIN'] +
remote_image_url + '&Auth&ACAOrigin=' + host_info['HTTPS_ORIGIN'] +
'&ACACredentials=true&ignore',
'use-credentials',
NOT_TAINTED),
@ -189,58 +189,64 @@ window.addEventListener('message', function(evt) {
image_url +
'&mode=cors&url=' +
encodeURIComponent(remote_image_url +
'&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'',
NOT_TAINTED),
TAINTED), // We expect TAINTED since the default origin behavior here
// is taint, and it doesn't matter what kind of fetch the
// SW performs.
create_test_promise(
image_url +
'&mode=cors&url=' +
encodeURIComponent(remote_image_url +
'&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'anonymous',
NOT_TAINTED),
create_test_promise(
image_url +
'&mode=cors&url=' +
encodeURIComponent(remote_image_url +
'&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'use-credentials',
NOT_TAINTED),
LOAD_ERROR), // We expect LOAD_ERROR since the server doesn't respond
// with an Access-Control-Allow-Credentials header.
create_test_promise(
image_url +
'&mode=cors&url=' +
encodeURIComponent(
remote_image_url +
'&ACACredentials=true&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACACredentials=true&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'use-credentials',
NOT_TAINTED),
create_test_promise(
remote_image_url +
'&mode=cors&url=' +
encodeURIComponent(remote_image_url +
'&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'',
NOT_TAINTED),
TAINTED), // We expect TAINTED since the default origin behavior here
// is taint, and it doesn't matter what kind of fetch the
// SW performs.
create_test_promise(
remote_image_url +
'&mode=cors&url=' +
encodeURIComponent(remote_image_url +
'&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'anonymous',
NOT_TAINTED),
create_test_promise(
remote_image_url +
'&mode=cors&url=' +
encodeURIComponent(remote_image_url +
'&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'use-credentials',
NOT_TAINTED),
LOAD_ERROR), // We expect LOAD_ERROR since the server doesn't respond
// with an Access-Control-Allow-Credentials header.
create_test_promise(
remote_image_url +
'&mode=cors&url=' +
encodeURIComponent(
remote_image_url +
'&ACACredentials=true&ACAOrigin=' + host_info['HTTP_ORIGIN']),
'&ACACredentials=true&ACAOrigin=' + host_info['HTTPS_ORIGIN']),
'use-credentials',
NOT_TAINTED)
])