forked from mirrors/gecko-dev
Bug 1508992 - Enable ESLint for dom/plugins/test/mochitest (Manual changes). r=Standard8,qdot
Differential Revision: https://phabricator.services.mozilla.com/D20094 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
1bb1750150
commit
10d17e2137
38 changed files with 87 additions and 72 deletions
|
|
@ -189,7 +189,6 @@ dom/network/**
|
|||
dom/payments/**
|
||||
dom/performance/**
|
||||
dom/permission/**
|
||||
dom/plugins/test/mochitest/**
|
||||
dom/plugins/test/unit/**
|
||||
dom/promise/**
|
||||
dom/push/**
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ add_task(async function() {
|
|||
|
||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
|
||||
|
||||
let testTab = gBrowser.selectedTab;
|
||||
let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
|
||||
let homeTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
var gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
|
||||
|
||||
const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
/**
|
||||
* tests for plugin windows and scroll
|
||||
*/
|
||||
|
|
@ -56,7 +58,6 @@ add_task(async function() {
|
|||
|
||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
|
||||
|
||||
let testTab = gBrowser.selectedTab;
|
||||
let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
|
||||
|
||||
result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
|
||||
|
|
@ -121,7 +122,6 @@ add_task(async function() {
|
|||
|
||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
|
||||
|
||||
let testTab = gBrowser.selectedTab;
|
||||
let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_subframe_test.html");
|
||||
|
||||
result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
|
||||
|
|
@ -183,7 +183,6 @@ add_task(async function() {
|
|||
|
||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
|
||||
|
||||
let testTab = gBrowser.selectedTab;
|
||||
let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
|
||||
|
||||
result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
|
||||
|
|
@ -248,7 +247,6 @@ add_task(async function() {
|
|||
|
||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
|
||||
|
||||
let testTab = gBrowser.selectedTab;
|
||||
let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_subframe_test.html");
|
||||
|
||||
result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-worker */
|
||||
|
||||
const EVENT_OBJECT_SHOW = 0x8002;
|
||||
const EVENT_OBJECT_HIDE = 0x8003;
|
||||
const WINEVENT_OUTOFCONTEXT = 0;
|
||||
|
|
@ -7,6 +9,7 @@ const INFINITE = 0xFFFFFFFF;
|
|||
const WAIT_OBJECT_0 = 0;
|
||||
const WAIT_TIMEOUT = 258;
|
||||
const PM_NOREMOVE = 0;
|
||||
var user32;
|
||||
|
||||
function DialogWatcher(titleText, onDialogStart, onDialogEnd) {
|
||||
this.titleText = titleText;
|
||||
|
|
@ -116,6 +119,7 @@ DialogWatcher.prototype.getWindowText = function(hwnd) {
|
|||
if (this.getWindowTextW(hwnd, buffer, buffer.length)) {
|
||||
return buffer.readString();
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
DialogWatcher.prototype.processWindowEvents = function(timeout) {
|
||||
|
|
@ -147,7 +151,7 @@ DialogWatcher.prototype.processWindowEvents = function(timeout) {
|
|||
0, callback, 0, 0,
|
||||
WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
|
||||
if (!hook) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
// Check if the window is already showing
|
||||
var hwnd = this.findWindow(null, this.titleText);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
|
|
@ -17,5 +18,5 @@ function getTestPlugin(pluginName) {
|
|||
|
||||
addMessageListener("check-plugin-unload", function(message) {
|
||||
var tag = getTestPlugin();
|
||||
var results = sendAsyncMessage("check-plugin-unload", tag.loaded);
|
||||
sendAsyncMessage("check-plugin-unload", tag.loaded);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ document.body.appendChild(i);
|
|||
i.addEventListener("load", function loaded() {
|
||||
var id = i.contentDocument;
|
||||
var e = id.createElement("embed");
|
||||
var callbackrun = false;
|
||||
e.width = 200;
|
||||
e.height = 200;
|
||||
e.type = "application/x-test";
|
||||
|
|
@ -33,7 +32,6 @@ i.addEventListener("load", function loaded() {
|
|||
ob.removeChild(i);
|
||||
id.body.clientTop;
|
||||
id.body.removeChild(e);
|
||||
callbackrun = true;
|
||||
});
|
||||
id.body.appendChild(e);
|
||||
e.clientTop;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
const {parseKeyValuePairsFromFile} = ChromeUtils.import("resource://gre/modules/KeyValueParser.jsm");
|
||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var success = false;
|
||||
var observerFired = false;
|
||||
|
|
@ -19,9 +20,7 @@ var testObserver = {
|
|||
isnot(pluginId, "", "got a non-empty plugin crash id");
|
||||
|
||||
// check plugin dump and extra files
|
||||
let directoryService =
|
||||
Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
let profD = directoryService.get("ProfD", Ci.nsIFile);
|
||||
let profD = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||||
profD.append("minidumps");
|
||||
let pluginDumpFile = profD.clone();
|
||||
pluginDumpFile.append(pluginId + ".dmp");
|
||||
|
|
@ -82,9 +81,7 @@ function onPluginCrashed(aEvent) {
|
|||
ok("submittedCrashReport" in aEvent, "submittedCrashReport is a property of event");
|
||||
is(typeof aEvent.submittedCrashReport, "boolean", "submittedCrashReport is correct type");
|
||||
|
||||
var os = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
os.removeObserver(testObserver, "plugin-crashed");
|
||||
Services.obs.removeObserver(testObserver, "plugin-crashed");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
/* eslint-env mozilla/chrome-worker */
|
||||
|
||||
var user32;
|
||||
var sendMessage;
|
||||
var getDlgItem;
|
||||
var messageBox;
|
||||
var watcher;
|
||||
|
||||
/* import-globals-from hangui_common.js */
|
||||
importScripts("hangui_common.js");
|
||||
/* import-globals-from dialog_watcher.js */
|
||||
importScripts("dialog_watcher.js");
|
||||
|
||||
function initCTypes() {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
this.document.mozCancelFullScreen();
|
||||
return fullScreenChange;
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
this.document.mozCancelFullScreen();
|
||||
return fullScreenChange;
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
this.document.mozCancelFullScreen();
|
||||
return fullScreenChange;
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
this.document.mozCancelFullScreen();
|
||||
return fullScreenChange;
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
this.document.mozCancelFullScreen();
|
||||
return fullScreenChange;
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
this.document.mozCancelFullScreen();
|
||||
return fullScreenChange;
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
this.document.mozCancelFullScreen();
|
||||
return fullScreenChange;
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
ok(true, "Test plugin unloaded in chrome process");
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
var results = script.sendAsyncMessage("check-plugin-unload");
|
||||
script.sendAsyncMessage("check-plugin-unload");
|
||||
}
|
||||
}
|
||||
testContentUnload();
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@
|
|||
}
|
||||
|
||||
function runTests() {
|
||||
p = document.getElementById("plugin1");
|
||||
var p = document.getElementById("plugin1");
|
||||
ok(p.setColor != undefined, "Static plugin parameter (salign/scale) ordering were correct");
|
||||
p2 = document.getElementById("plugin2");
|
||||
var p2 = document.getElementById("plugin2");
|
||||
ok(p2.setColor != undefined, "Dynamic plugin parameter (salign/scale) ordering were correct");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,13 +22,14 @@ function runTests() {
|
|||
waitedForPaint++;
|
||||
moveBy = -moveBy;
|
||||
$("abs").style.left = ($("abs").offsetLeft + moveBy) + "px";
|
||||
var x = document.documentElement.offsetHeight;
|
||||
document.documentElement.offsetHeight;
|
||||
var pc = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
|
||||
if (waitedForPaint == 20 || (pc != testplugin.last_paint_count && pc >= 0)) {
|
||||
setTimeout(func, 0);
|
||||
} else
|
||||
} else {
|
||||
setTimeout(waitForPaintCountIncrement, 50);
|
||||
}
|
||||
}
|
||||
waitForPaintCountIncrement();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,13 +22,14 @@ function runTests() {
|
|||
waitedForPaint++;
|
||||
moveBy = -moveBy;
|
||||
$("abs").style.left = ($("abs").offsetLeft + moveBy) + "px";
|
||||
var x = document.documentElement.offsetHeight;
|
||||
document.documentElement.offsetHeight;
|
||||
var pc = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
|
||||
if (waitedForPaint == 20 || (pc != testplugin.last_paint_count && pc >= 0)) {
|
||||
setTimeout(func, 0);
|
||||
} else
|
||||
} else {
|
||||
setTimeout(waitForPaintCountIncrement, 50);
|
||||
}
|
||||
}
|
||||
waitForPaintCountIncrement();
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +77,7 @@ function runTests() {
|
|||
var container = $("container");
|
||||
container.style.MozTransformOrigin = "0px 0px";
|
||||
container.style.MozTransform = "scale(0.5)";
|
||||
var x = document.documentElement.offsetHeight;
|
||||
document.documentElement.offsetHeight;
|
||||
click(60, 52, function() { verify("4", 240, 208, test5); });
|
||||
}
|
||||
function test5() { // fullZoom=2 + scale(2)
|
||||
|
|
@ -84,7 +85,7 @@ function runTests() {
|
|||
var container = $("container");
|
||||
container.style.MozTransformOrigin = "0px 0px";
|
||||
container.style.MozTransform = "scale(2)";
|
||||
var x = document.documentElement.offsetHeight;
|
||||
document.documentElement.offsetHeight;
|
||||
click(108, 112, function() { verify("5", 108, 112, endTest); });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
// Triggering a paint and waiting for it to be flushed makes sure
|
||||
// that both plugin and platform see the plugin element as visible.
|
||||
// See bug 805330 for details.
|
||||
/* global waitForAllPaintsFlushed */
|
||||
plugin.setColor("FF000088");
|
||||
waitForAllPaintsFlushed(afterPaintsFlushed);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ function go() {
|
|||
|
||||
// Force a re-instantiate by re-setting dummy uri,
|
||||
// making val a wrapper for a dead plugin
|
||||
// eslint-disable-next-line no-self-assign
|
||||
plugin.data = plugin.data;
|
||||
|
||||
// The correct behavior is an exception, if plugin.checkObjectValue succeeds
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@
|
|||
nested_parent.style.display = "inherit";
|
||||
|
||||
// Ensure plugins are spawned
|
||||
var body_obj = getObjectValue(body_embed);
|
||||
var nested_obj = getObjectValue(nested_embed);
|
||||
isnot(body_obj, null, "body plugin spawned");
|
||||
isnot(nested_obj, null, "nested plugin spawned");
|
||||
var body_objs = getObjectValue(body_embed);
|
||||
var nested_objs = getObjectValue(nested_embed);
|
||||
isnot(body_objs, null, "body plugin spawned");
|
||||
isnot(nested_objs, null, "nested plugin spawned");
|
||||
|
||||
// Take away frames again, flush layout, restore frames
|
||||
body_embed.style.display = "none";
|
||||
|
|
@ -75,8 +75,8 @@
|
|||
|
||||
// Spin event loop, ensure plugin remains running
|
||||
SimpleTest.executeSoon(function() {
|
||||
ok(body_embed.checkObjectValue(body_obj), "body plugin still running");
|
||||
ok(nested_embed.checkObjectValue(nested_obj), "nested plugin still running");
|
||||
ok(body_embed.checkObjectValue(body_objs), "body plugin still running");
|
||||
ok(nested_embed.checkObjectValue(nested_objs), "nested plugin still running");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ ok(thrown, "Function call should have thrown");
|
|||
ok(!spPlugin.hasRunningPlugin, "Plugin should not have spawned");
|
||||
|
||||
// Try property access from content
|
||||
var hi = plugin._testShouldntExistContent;
|
||||
hi = plugin._testShouldntExistContent;
|
||||
ok(spPlugin.hasRunningPlugin, "Should've caused plugin to spawn");
|
||||
|
||||
// Property set
|
||||
|
|
|
|||
|
|
@ -76,28 +76,28 @@
|
|||
ok(stored(["foo.com", "bar.com", "baz.com", "qux.com", "quz.com"]),
|
||||
"Data stored for sites");
|
||||
|
||||
pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 4, {callback() { test2(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 4, {callback() { test2(); }});
|
||||
}
|
||||
function test2() {
|
||||
ok(stored(["foo.com", "bar.com", "baz.com", "qux.com", "quz.com"]),
|
||||
"Data stored for sites");
|
||||
|
||||
// Clear cache data 5 seconds or older.
|
||||
pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 5, {callback() { test3(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 5, {callback() { test3(); }});
|
||||
}
|
||||
function test3() {
|
||||
ok(stored(["foo.com", "bar.com", "baz.com", "quz.com"]),
|
||||
"Data stored for sites");
|
||||
ok(!stored(["qux.com"]), "Data cleared for qux.com");
|
||||
// Clear cache data for foo.com, but leave non-cache data.
|
||||
pluginHost.clearSiteData(pluginTag, "foo.com", FLAG_CLEAR_CACHE, 20, {callback() { test4(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "foo.com", FLAG_CLEAR_CACHE, 20, {callback() { test4(); }});
|
||||
}
|
||||
function test4() {
|
||||
ok(stored(["foo.com", "bar.com", "baz.com", "quz.com"]),
|
||||
"Data stored for sites");
|
||||
|
||||
// Clear all data 7 seconds or older.
|
||||
pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 7, {callback() { test5(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_ALL, 7, {callback() { test5(); }});
|
||||
}
|
||||
function test5() {
|
||||
ok(stored(["bar.com", "baz.com", "quz.com"]), "Data stored for sites");
|
||||
|
|
@ -105,58 +105,58 @@
|
|||
ok(!stored(["qux.com"]), "Data cleared for qux.com");
|
||||
|
||||
// Clear all cache data.
|
||||
pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback() { test6(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback() { test6(); }});
|
||||
}
|
||||
function test6() {
|
||||
ok(stored(["bar.com", "baz.com"]), "Data stored for sites");
|
||||
ok(!stored(["quz.com"]), "Data cleared for quz.com");
|
||||
|
||||
// Clear all data for bar.com.
|
||||
pluginHost.clearSiteData(pluginTag, "bar.com", FLAG_CLEAR_ALL, 20, {callback(rv) { test7(rv); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "bar.com", FLAG_CLEAR_ALL, 20, {callback(rv) { test7(rv); }});
|
||||
}
|
||||
function test7(rv) {
|
||||
function test7() {
|
||||
ok(stored(["baz.com"]), "Data stored for baz.com");
|
||||
ok(!stored(["bar.com"]), "Data cleared for bar.com");
|
||||
|
||||
// Disable clearing by age.
|
||||
p.setSitesWithDataCapabilities(false);
|
||||
|
||||
pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 20, {callback(rv) {
|
||||
pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_ALL, 20, {callback(rv) {
|
||||
is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
|
||||
test8(rv);
|
||||
}});
|
||||
}
|
||||
function test8(rv) {
|
||||
pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback(rv) {
|
||||
function test8() {
|
||||
pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback(rv) {
|
||||
is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
|
||||
test9(rv);
|
||||
}});
|
||||
}
|
||||
function test9(rv) {
|
||||
pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_ALL, 20, {callback(rv) {
|
||||
function test9() {
|
||||
pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_ALL, 20, {callback(rv) {
|
||||
is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
|
||||
test10(rv);
|
||||
}});
|
||||
}
|
||||
function test10(rv) {
|
||||
pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_CACHE, 20, {callback(rv) {
|
||||
function test10() {
|
||||
pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_CACHE, 20, {callback(rv) {
|
||||
is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
|
||||
test11();
|
||||
}});
|
||||
}
|
||||
function test11() {
|
||||
// Clear cache for baz.com and globally for all ages.
|
||||
pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_CACHE, -1, {callback(rv) { test12(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_CACHE, -1, {callback(rv) { test12(); }});
|
||||
}
|
||||
function test12() {
|
||||
pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, -1, {callback(rv) { test13(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, -1, {callback(rv) { test13(); }});
|
||||
}
|
||||
function test13() {
|
||||
// Check that all of the above were no-ops.
|
||||
ok(stored(["baz.com"]), "Data stored for baz.com");
|
||||
|
||||
// Clear everything for baz.com.
|
||||
pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test14(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test14(); }});
|
||||
}
|
||||
function test14() {
|
||||
ok(!stored(["baz.com"]), "Data cleared for baz.com");
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
"Data stored for sites");
|
||||
|
||||
// Clear data for "foo.com" and its subdomains.
|
||||
pluginHost.clearSiteData(pluginTag, "foo.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test15(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "foo.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test15(); }});
|
||||
}
|
||||
function test15() {
|
||||
ok(stored(["bar.com", "192.168.1.1", "localhost"]), "Data stored for sites");
|
||||
|
|
@ -183,19 +183,19 @@
|
|||
ok(!stored(["bar.foo.com"]), "Data cleared for subdomains of foo.com");
|
||||
|
||||
// Clear data for "bar.com" using a subdomain.
|
||||
pluginHost.clearSiteData(pluginTag, "foo.bar.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test16(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "foo.bar.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test16(); }});
|
||||
}
|
||||
function test16() {
|
||||
ok(!stored(["bar.com"]), "Data cleared for bar.com");
|
||||
|
||||
// Clear data for "192.168.1.1".
|
||||
pluginHost.clearSiteData(pluginTag, "192.168.1.1", FLAG_CLEAR_ALL, -1, {callback(rv) { test17(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "192.168.1.1", FLAG_CLEAR_ALL, -1, {callback(rv) { test17(); }});
|
||||
}
|
||||
function test17() {
|
||||
ok(!stored(["192.168.1.1"]), "Data cleared for 192.168.1.1");
|
||||
|
||||
// Clear data for "localhost".
|
||||
pluginHost.clearSiteData(pluginTag, "localhost", FLAG_CLEAR_ALL, -1, {callback(rv) { test18(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "localhost", FLAG_CLEAR_ALL, -1, {callback(rv) { test18(); }});
|
||||
}
|
||||
function test18() {
|
||||
ok(!stored(null), "All data cleared");
|
||||
|
|
@ -211,14 +211,14 @@
|
|||
"Data stored for sites");
|
||||
|
||||
// Clear data for the UTF-8 version.
|
||||
pluginHost.clearSiteData(pluginTag, "b\u00FCcher.es", FLAG_CLEAR_ALL, -1, {callback(rv) { test19(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "b\u00FCcher.es", FLAG_CLEAR_ALL, -1, {callback(rv) { test19(); }});
|
||||
}
|
||||
function test19() {
|
||||
ok(!stored(["b\u00FCcher.es"]), "Data cleared for UTF-8 representation");
|
||||
ok(!stored(["xn--bcher-kva.es"]), "Data cleared for ACE representation");
|
||||
|
||||
// Clear data for the ACE version.
|
||||
pluginHost.clearSiteData(pluginTag, "xn--bcher-kva.uk", FLAG_CLEAR_ALL, -1, {callback(rv) { test20(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "xn--bcher-kva.uk", FLAG_CLEAR_ALL, -1, {callback(rv) { test20(); }});
|
||||
}
|
||||
function test20() {
|
||||
ok(!stored(["b\u00FCcher.uk"]), "Data cleared for UTF-8 representation");
|
||||
|
|
@ -229,7 +229,7 @@
|
|||
// strictly required, we test it here.
|
||||
ok(stored(["b\u00FCcher.nz", "xn--bcher-kva.nz"]),
|
||||
"Data stored for sites");
|
||||
pluginHost.clearSiteData(pluginTag, "b\u00FCcher.nz", FLAG_CLEAR_ALL, -1, {callback(rv) { test21(); }});
|
||||
pluginHost.clearSiteData(this.pluginTag, "b\u00FCcher.nz", FLAG_CLEAR_ALL, -1, {callback(rv) { test21(); }});
|
||||
}
|
||||
function test21() {
|
||||
ok(!stored(["b\u00FCcher.nz"]), "Data cleared for UTF-8 representation");
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@
|
|||
}
|
||||
|
||||
window.frameLoaded = function reloaded() {
|
||||
var p = iframe.contentDocument.getElementById("plugin1");
|
||||
var p1 = iframe.contentDocument.getElementById("plugin1");
|
||||
try {
|
||||
p.setColor("FF00FF00");
|
||||
p1.setColor("FF00FF00");
|
||||
ok(true, "Reloading worked");
|
||||
} catch (e) {
|
||||
ok(false, "Reloading didn't give us a usable plugin");
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@
|
|||
}
|
||||
|
||||
window.frameLoaded = function reloaded() {
|
||||
var p = iframe.contentDocument.getElementById("plugin1");
|
||||
var p1 = iframe.contentDocument.getElementById("plugin1");
|
||||
try {
|
||||
p.setColor("FF00FF00");
|
||||
p1.setColor("FF00FF00");
|
||||
ok(true, "Reloading worked");
|
||||
} catch (e) {
|
||||
ok(false, "Reloading didn't give us a usable plugin");
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ SpecialPowers.pushPrefEnv({"set": [["security.allow_eval_with_system_principal",
|
|||
true]]});
|
||||
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
|
||||
|
||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const hangUITimeoutPref = "dom.ipc.plugins.hangUITimeoutSecs";
|
||||
const hangUIMinDisplayPref = "dom.ipc.plugins.hangUIMinDisplaySecs";
|
||||
const timeoutPref = "dom.ipc.plugins.timeoutSecs";
|
||||
|
|
|
|||
|
|
@ -14,10 +14,9 @@
|
|||
let ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"].getService(SpecialPowers.Ci.nsIPluginHost);
|
||||
let plugins = ph.getPluginTags();
|
||||
let testPluginName = plugins[0].name;
|
||||
let oldPrefVal = null;
|
||||
let prefName = "plugins.navigator.hidden_ctp_plugin";
|
||||
try {
|
||||
oldPrefVal = SpecialPowers.getCharPref(prefName);
|
||||
SpecialPowers.getCharPref(prefName);
|
||||
} catch (ex) {}
|
||||
let promise = SpecialPowers.pushPrefEnv({ set: [[prefName, testPluginName]]});
|
||||
promise.then(function() {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
d1.appendChild(p);
|
||||
|
||||
// Forces the plugin to be respawned
|
||||
// eslint-disable-next-line no-self-assign
|
||||
p.src = p.src;
|
||||
|
||||
destroyed = false;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
["function test() { return 3; } test();", 3],
|
||||
["testMe(3)", 6],
|
||||
["testMe(new Object(3))", 6],
|
||||
// eslint-disable-next-line no-new-object
|
||||
["new Object(3)", new Object(3)],
|
||||
["new Array(1, 2, 3, 4)", [1, 2, 3, 4]],
|
||||
["document.getElementById('display')",
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
function returnArgs() {
|
||||
if (arguments.length == 1)
|
||||
return arguments[0];
|
||||
var arr = new Array();
|
||||
for (i = 0; i < arguments.length; i++) {
|
||||
var arr = [];
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
arr.push(arguments[i]);
|
||||
}
|
||||
return arr;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
["Boolean", true, true],
|
||||
["Boolean", "true", true],
|
||||
["Boolean", "false", true],
|
||||
/* eslint-disable no-new-wrappers */
|
||||
["Boolean", new Boolean(false), true],
|
||||
["Boolean", { "value": false }, true],
|
||||
// Function object
|
||||
|
|
@ -60,6 +61,7 @@
|
|||
["Object", Boolean(), new Boolean(false)],
|
||||
["Object", "a string", new String("a string")],
|
||||
["Object", 3.14, new Number(3.14)],
|
||||
/* eslint-enable no-new-wrappers */
|
||||
["Object", { "key1": "test", "key2": 15 }, { "key1": "test", "key2": 15 }],
|
||||
["Object", [1, 3, 5, 7, 9, 11, 13, 17], [1, 3, 5, 7, 9, 11, 13, 17]],
|
||||
// RegExp object
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ function eachList() {
|
|||
},
|
||||
};
|
||||
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
function testObject(obj, state) {
|
||||
// If our test combination both sets noChannel but no explicit type
|
||||
// it shouldn't load ever.
|
||||
|
|
@ -316,7 +316,7 @@ function eachList() {
|
|||
// should spawn synchronously.
|
||||
let scripted = false;
|
||||
try {
|
||||
let x = obj.getObjectValue();
|
||||
obj.getObjectValue();
|
||||
scripted = true;
|
||||
} catch (e) {}
|
||||
is(scripted, shouldBeSpawnable, "check plugin scriptability");
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ function waitForPaint(func) {
|
|||
// Ensure the waiter has had a style change, so that this will
|
||||
// change its size and cause a paint.
|
||||
paint_waiter.style.backgroundColor = paint_waiter.style.backgroundColor == "blue" ? "yellow" : "blue";
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
var flush = paint_waiter.offsetHeight;
|
||||
paint_waiter.style.height = "1px";
|
||||
waitForPaintHelper(func);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function continueTest() {
|
|||
var test = tests[Math.floor(index / 2)];
|
||||
|
||||
var p = gTestWindow.document.createElement("p");
|
||||
p.innerHTML = "Plugin Stream Test " + index;
|
||||
p.textContent = "Plugin Stream Test " + Number(index);
|
||||
gTestWindow.document.getElementById("test").appendChild(p);
|
||||
|
||||
if (test.frame) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
var startY;
|
||||
|
||||
function doScroll() {
|
||||
let [x, y, w, h] = p.getWindowPosition();
|
||||
let y = p.getWindowPosition()[1];
|
||||
startY = y;
|
||||
|
||||
scrollBy(0, kScrollAmount);
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
}
|
||||
|
||||
function checkScroll() {
|
||||
let [x, y, w, h] = p.getWindowPosition();
|
||||
let y = p.getWindowPosition()[1];
|
||||
|
||||
is(y, startY - kScrollAmount, "Window should be informed of its new position.");
|
||||
SimpleTest.finish();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
}
|
||||
|
||||
function runTests() {
|
||||
p = document.getElementById("plugin1");
|
||||
var p = document.getElementById("plugin1");
|
||||
|
||||
p.startWatchingInstanceCount();
|
||||
p.callOnDestroy(onDestroy);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
var didPaint = function() {};
|
||||
|
||||
var p = null;
|
||||
|
||||
function startTest() {
|
||||
if (p.getPaintCount() < 1) {
|
||||
setTimeout(startTest, 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue