Bug 1335475 - Switch browser_tab_dragdrop.js to load a plugin from HTTP instead of a no-privilege data: URI which doesn't work any more. Also re-enable this test on Linux now that we don't have windowed-mode plugins any more, so this won't assert (undo
bug 1331320). r=jaws
MozReview-Commit-ID: D6JzYliULPG
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -10,16 +10,17 @@ support-files =
browser_bug479408_sample.html
browser_bug678392-1.html
browser_bug678392-2.html
browser_bug970746.xhtml
browser_fxa_web_channel.html
browser_registerProtocolHandler_notification.html
browser_star_hsts.sjs
browser_tab_dragdrop2_frame1.xul
+ browser_tab_dragdrop_embed.html
browser_web_channel.html
browser_web_channel_iframe.html
bug1262648_string_with_newlines.dtd
bug592338.html
bug792517-2.html
bug792517.html
bug792517.sjs
bug839103.css
@@ -332,17 +333,17 @@ support-files =
[browser_syncui.js]
skip-if = os == 'linux' # Bug 1304272
[browser_tab_close_dependent_window.js]
[browser_tabDrop.js]
[browser_tabReorder.js]
[browser_tab_detach_restore.js]
[browser_tab_drag_drop_perwindow.js]
[browser_tab_dragdrop.js]
-skip-if = buildapp == 'mulet' || (e10s && (debug || os == 'linux')) # Bug 1312436
+skip-if = buildapp == 'mulet' || (e10s && debug) # Bug 1312436
[browser_tab_dragdrop2.js]
[browser_tabbar_big_widgets.js]
skip-if = os == "linux" || os == "mac" # No tabs in titlebar on linux
# Disabled on OS X because of bug 967917
[browser_tabfocus.js]
[browser_tabkeynavigation.js]
skip-if = (os == "mac" && !e10s) # Bug 1237713 - OSX eats keypresses for some reason
[browser_tabopen_reflows.js]
--- a/browser/base/content/test/general/browser_tab_dragdrop.js
+++ b/browser/base/content/test/general/browser_tab_dragdrop.js
@@ -35,17 +35,17 @@ function loadURI(tab, url) {
}
// Creates a framescript which caches the current object value from the plugin
// in the page. checkObjectValue below verifies that the framescript is still
// active for the browser and that the cached value matches that from the plugin
// in the page which tells us the plugin hasn't been reinitialized.
function* cacheObjectValue(browser) {
yield ContentTask.spawn(browser, null, function*() {
- let plugin = content.document.wrappedJSObject.body.firstChild;
+ let plugin = content.document.getElementById("p").wrappedJSObject;
info(`plugin is ${plugin}`);
let win = content.document.defaultView;
info(`win is ${win}`);
win.objectValue = plugin.getObjectValue();
info(`got objectValue: ${win.objectValue}`);
win.checkObjectValueListener = () => {
let result;
let exception;
@@ -98,33 +98,32 @@ function checkObjectValue(browser) {
};
mm.addMessageListener("Test:CheckObjectValueResult", listener);
mm.sendAsyncMessage("Test:CheckObjectValue");
});
}
add_task(function*() {
- let embed = '<embed type="application/x-test" allowscriptaccess="always" allowfullscreen="true" wmode="window" width="640" height="480"></embed>'
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED);
// create a few tabs
let tabs = [
gBrowser.tabs[0],
gBrowser.addTab("about:blank", {skipAnimation: true}),
gBrowser.addTab("about:blank", {skipAnimation: true}),
gBrowser.addTab("about:blank", {skipAnimation: true}),
gBrowser.addTab("about:blank", {skipAnimation: true})
];
// Initially 0 1 2 3 4
yield loadURI(tabs[1], "data:text/html;charset=utf-8,<title>tab1</title><body>tab1<iframe>");
yield loadURI(tabs[2], "data:text/plain;charset=utf-8,tab2");
yield loadURI(tabs[3], "data:text/html;charset=utf-8,<title>tab3</title><body>tab3<iframe>");
- yield loadURI(tabs[4], "data:text/html;charset=utf-8,<body onload='clicks=0' onclick='++clicks'>" + embed);
+ yield loadURI(tabs[4], "http://example.com/browser/browser/base/content/test/general/browser_tab_dragdrop_embed.html");
yield BrowserTestUtils.switchTab(gBrowser, tabs[3]);
swapTabsAndCloseOther(2, 3); // now: 0 1 2 4
is(gBrowser.tabs[1], tabs[1], "tab1");
is(gBrowser.tabs[2], tabs[3], "tab3");
is(gBrowser.tabs[3], tabs[4], "tab4");
delete tabs[2];
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/general/browser_tab_dragdrop_embed.html
@@ -0,0 +1,2 @@
+<body onload="clicks=0" onclick="++clicks">
+ <embed type="application/x-test" allowscriptaccess="always" allowfullscreen="true" wmode="window" width="640" height="480" id="p"></embed>