forked from mirrors/gecko-dev
--HG-- extra : rebase_source : 44b0737c88442b5afbb5f9f2e9458c6321442e8e extra : source : 8da0582cde7ed894e195f9886d701976a5f25976 extra : histedit_source : b0f8cae0da36ef1d3e2b70955d03e032143b2ae7
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
/**
|
|
* Test that the notification bar for crashed GMPs works.
|
|
*/
|
|
add_task(function*() {
|
|
yield BrowserTestUtils.withNewTab({
|
|
gBrowser,
|
|
url: "about:blank",
|
|
}, function* (browser) {
|
|
yield ContentTask.spawn(browser, null, 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 = yield 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.getAttribute("label"),
|
|
"The GlobalTestPlugin plugin has crashed.",
|
|
"Correct message.");
|
|
});
|
|
});
|