Bug 1480899 follow-up - address the review comments properly, DONTBUILD

This commit is contained in:
Ehsan Akhgari 2018-08-13 17:34:28 -04:00
parent a1ed764131
commit 87edbe15d3
4 changed files with 5 additions and 8 deletions

View File

@ -21,7 +21,6 @@ function is(a, b, msg) {
onmessage = function(e) { onmessage = function(e) {
let runnableStr = `(() => {return (${e.data});})();`; let runnableStr = `(() => {return (${e.data});})();`;
let runnable = eval(runnableStr); // eslint-disable-line no-eval let runnable = eval(runnableStr); // eslint-disable-line no-eval
// Phase 1: Here we want to test that a 3rd party context is not blocked if pref is off
runnable.call(this, /* Phase */ 1).then(_ => { runnable.call(this, /* Phase */ 1).then(_ => {
parent.postMessage({ type: "finish" }, "*"); parent.postMessage({ type: "finish" }, "*");
}); });

View File

@ -21,8 +21,6 @@ function is(a, b, msg) {
onmessage = function(e) { onmessage = function(e) {
let runnableStr = `(() => {return (${e.data.callback});})();`; let runnableStr = `(() => {return (${e.data.callback});})();`;
let runnable = eval(runnableStr); // eslint-disable-line no-eval let runnable = eval(runnableStr); // eslint-disable-line no-eval
// Phase 3: Here we want to test that a third-party context doesn't
// get blocked with user interaction present
runnable.call(this, /* Phase */ 3).then(_ => { runnable.call(this, /* Phase */ 3).then(_ => {
parent.postMessage({ type: "finish" }, "*"); parent.postMessage({ type: "finish" }, "*");
}); });

View File

@ -21,8 +21,6 @@ function is(a, b, msg) {
onmessage = function(e) { onmessage = function(e) {
let runnableStr = `(() => {return (${e.data.blockingCallback});})();`; let runnableStr = `(() => {return (${e.data.blockingCallback});})();`;
let runnable = eval(runnableStr); // eslint-disable-line no-eval let runnable = eval(runnableStr); // eslint-disable-line no-eval
// Phase 2: Here we want to test that a third-party context doesn't
// get blocked with when the same origin is opened through window.open().
runnable.call(this, /* Phase */ 2).then(_ => { runnable.call(this, /* Phase */ 2).then(_ => {
info("Let's do a window.open()"); info("Let's do a window.open()");
return new Promise(resolve => { return new Promise(resolve => {

View File

@ -20,17 +20,19 @@ this.AntiTracking = {
this._createCleanupTask(cleanupFunction); this._createCleanupTask(cleanupFunction);
if (callbackNonTracking) { if (callbackNonTracking) {
// Here we want to test that a 3rd party context is not blocked if pref is off. // Phase 1: Here we want to test that a 3rd party context is not blocked if pref is off.
this._createTask(name, false, callbackNonTracking); this._createTask(name, false, callbackNonTracking);
this._createCleanupTask(cleanupFunction); this._createCleanupTask(cleanupFunction);
// Permission granted when there is a window.open() // Phase 2: Here we want to test that a third-party context doesn't
// get blocked with when the same origin is opened through window.open().
if (windowOpenTest) { if (windowOpenTest) {
this._createWindowOpenTask(name, callbackTracking, callbackNonTracking, extraPrefs); this._createWindowOpenTask(name, callbackTracking, callbackNonTracking, extraPrefs);
this._createCleanupTask(cleanupFunction); this._createCleanupTask(cleanupFunction);
} }
// Permission granted when there is user-interaction. // Phase 3: Here we want to test that a third-party context doesn't
// get blocked with user interaction present
if (userInteractionTest) { if (userInteractionTest) {
this._createUserInteractionTask(name, callbackTracking, callbackNonTracking, extraPrefs); this._createUserInteractionTask(name, callbackTracking, callbackNonTracking, extraPrefs);
this._createCleanupTask(cleanupFunction); this._createCleanupTask(cleanupFunction);