Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' 7b878fa into embedlite
Followup fix for bug 972555
- Loading branch information
Showing
207 changed files
with
4,838 additions
and
1,847 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[DEFAULT] | ||
support-files = | ||
../../../content/media/test/bug461281.ogg | ||
dumbfile.xpi | ||
formimage.png | ||
letters.gif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
browser/base/content/test/general/browser_CTP_hide_overlay.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
var rootDir = getRootDirectory(gTestPath); | ||
const gTestRoot = rootDir; | ||
const gHttpTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/"); | ||
|
||
var gTestBrowser = null; | ||
var gNextTest = null; | ||
var gPluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost); | ||
|
||
Components.utils.import("resource://gre/modules/Services.jsm"); | ||
|
||
function test() { | ||
waitForExplicitFinish(); | ||
registerCleanupFunction(function() { | ||
clearAllPluginPermissions(); | ||
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); | ||
}); | ||
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); | ||
|
||
let newTab = gBrowser.addTab(); | ||
gBrowser.selectedTab = newTab; | ||
gTestBrowser = gBrowser.selectedBrowser; | ||
gTestBrowser.addEventListener("load", pageLoad, true); | ||
|
||
Services.prefs.setBoolPref("plugins.click_to_play", true); | ||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_DISABLED); | ||
|
||
prepareTest(runAfterPluginBindingAttached(test1), gHttpTestRoot + "plugin_test.html"); | ||
} | ||
|
||
function finishTest() { | ||
clearAllPluginPermissions(); | ||
gTestBrowser.removeEventListener("load", pageLoad, true); | ||
gBrowser.removeCurrentTab(); | ||
window.focus(); | ||
finish(); | ||
} | ||
|
||
function pageLoad() { | ||
// The plugin events are async dispatched and can come after the load event | ||
// This just allows the events to fire before we then go on to test the states | ||
executeSoon(gNextTest); | ||
} | ||
|
||
function prepareTest(nextTest, url) { | ||
gNextTest = nextTest; | ||
gTestBrowser.contentWindow.location = url; | ||
} | ||
|
||
// Due to layout being async, "PluginBindAttached" may trigger later. | ||
// This wraps a function to force a layout flush, thus triggering it, | ||
// and schedules the function execution so they're definitely executed | ||
// afterwards. | ||
function runAfterPluginBindingAttached(func) { | ||
return function() { | ||
let doc = gTestBrowser.contentDocument; | ||
let elems = doc.getElementsByTagName('embed'); | ||
if (elems.length < 1) { | ||
elems = doc.getElementsByTagName('object'); | ||
} | ||
elems[0].clientTop; | ||
executeSoon(func); | ||
}; | ||
} | ||
|
||
// Tests that the overlay can be hidded for disabled plugins using the close icon. | ||
function test1() { | ||
var doc = gTestBrowser.contentDocument; | ||
var plugin = doc.getElementById("test"); | ||
ok(plugin, "Test 1, Found plugin in page"); | ||
var overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main"); | ||
ok(overlay.classList.contains("visible"), "Test 1, Plugin overlay should exist, not be hidden"); | ||
var closeIcon = doc.getAnonymousElementByAttribute(plugin, "anonid", "closeIcon") | ||
EventUtils.synthesizeMouseAtCenter(closeIcon, {}, gTestBrowser.contentWindow); | ||
var condition = function() !overlay.classList.contains("visible"); | ||
waitForCondition(condition, finishTest, "Test 1, Waited too long for the overlay to become invisible."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.