mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 798237 - add test for bug 797677 r=jaws
This commit is contained in:
parent
00695ab541
commit
ee551a86c7
@ -158,6 +158,7 @@ _BROWSER_FILES = \
|
||||
browser_bug763468.js \
|
||||
browser_bug767836.js \
|
||||
browser_bug783614.js \
|
||||
browser_bug797677.js \
|
||||
browser_canonizeURL.js \
|
||||
browser_customize.js \
|
||||
browser_findbarClose.js \
|
||||
@ -240,6 +241,7 @@ _BROWSER_FILES = \
|
||||
plugin_clickToPlayAllow.html \
|
||||
plugin_clickToPlayDeny.html \
|
||||
plugin_bug749455.html \
|
||||
plugin_bug797677.html \
|
||||
plugin_hidden_to_visible.html \
|
||||
plugin_two_types.html \
|
||||
alltabslistener.html \
|
||||
|
47
browser/base/content/test/browser_bug797677.js
Normal file
47
browser/base/content/test/browser_bug797677.js
Normal file
@ -0,0 +1,47 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var rootDir = getRootDirectory(gTestPath);
|
||||
const gHttpTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
var gTestBrowser = null;
|
||||
var gConsoleErrors = 0;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
var newTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = newTab;
|
||||
gTestBrowser = gBrowser.selectedBrowser;
|
||||
gTestBrowser.addEventListener("PluginNotFound", pluginNotFound, true);
|
||||
var consoleService = Cc["@mozilla.org/consoleservice;1"]
|
||||
.getService(Ci.nsIConsoleService);
|
||||
var errorListener = {
|
||||
observe: function(aMessage) {
|
||||
if (aMessage.message.contains("NS_ERROR"))
|
||||
gConsoleErrors++;
|
||||
}
|
||||
};
|
||||
consoleService.registerListener(errorListener);
|
||||
registerCleanupFunction(function() {
|
||||
gTestBrowser.removeEventListener("PluginNotFound", pluginNotFound, true);
|
||||
consoleService.unregisterListener(errorListener);
|
||||
gBrowser.removeCurrentTab();
|
||||
window.focus();
|
||||
});
|
||||
gTestBrowser.contentWindow.location = gHttpTestRoot + "plugin_bug797677.html";
|
||||
}
|
||||
|
||||
function pluginNotFound() {
|
||||
// Let browser-plugins.js handle the PluginNotFound event, then run the test
|
||||
executeSoon(runTest);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var doc = gTestBrowser.contentDocument;
|
||||
var plugin = doc.getElementById("plugin");
|
||||
ok(plugin, "plugin should be in the page");
|
||||
is(gConsoleErrors, 0, "should have no console errors");
|
||||
finish();
|
||||
}
|
5
browser/base/content/test/plugin_bug797677.html
Normal file
5
browser/base/content/test/plugin_bug797677.html
Normal file
@ -0,0 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><meta charset="utf-8"/></head>
|
||||
<body><embed id="plugin" type="9000"></embed></body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user