forked from mirrors/gecko-dev
Differential Revision: https://phabricator.services.mozilla.com/D11650 --HG-- rename : browser/components/customizableui/content/.eslintrc.js => browser/components/translation/content/.eslintrc.js rename : browser/components/translation/jar.mn => browser/components/translation/content/jar.mn rename : browser/components/translation/microsoft-translator-attribution.png => browser/components/translation/content/microsoft-translator-attribution.png rename : browser/components/customizableui/content/moz.build => browser/components/translation/content/moz.build rename : browser/components/translation/translation-infobar.xml => browser/components/translation/content/translation-notification.js extra : rebase_source : 598396d2da96b04782413946976f7bb9fb6be75f
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
/**
|
|
* Test that the notification bar for crashed GMPs works.
|
|
*/
|
|
add_task(async function() {
|
|
await BrowserTestUtils.withNewTab({
|
|
gBrowser,
|
|
url: "about:blank",
|
|
}, async function(browser) {
|
|
await ContentTask.spawn(browser, null, async function() {
|
|
const GMP_CRASH_EVENT = {
|
|
pluginID: 1,
|
|
pluginName: "GlobalTestPlugin",
|
|
submittedCrashReport: false,
|
|
bubbles: true,
|
|
cancelable: true,
|
|
gmpPlugin: true,
|
|
};
|
|
|
|
let crashEvent = new content.PluginCrashedEvent("PluginCrashed",
|
|
GMP_CRASH_EVENT);
|
|
content.dispatchEvent(crashEvent);
|
|
});
|
|
|
|
let notification = await waitForNotificationBar("plugin-crashed", browser);
|
|
|
|
let notificationBox = gBrowser.getNotificationBox(browser);
|
|
ok(notification, "Infobar was shown.");
|
|
is(notification.priority, notificationBox.PRIORITY_WARNING_MEDIUM,
|
|
"Correct priority.");
|
|
is(notification.messageText.textContent,
|
|
"The GlobalTestPlugin plugin has crashed.",
|
|
"Correct message.");
|
|
});
|
|
});
|