Bug 1553784 - Add mochitest for empty list of service workers r=Ola

Differential Revision: https://phabricator.services.mozilla.com/D34154

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Belén Albeza 2019-06-11 21:23:59 +00:00
Родитель b2cdaf13a8
Коммит 9a15238677
3 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -44,7 +44,7 @@ class WorkerListEmpty extends Component {
render() {
return article(
{ className: "worker-list-empty" },
{ className: "worker-list-empty js-worker-list-empty" },
Localized({
id: "serviceworker-empty-intro",
a: a({ className: "external-link", onClick: () => this.openDocumentation() }),

Просмотреть файл

@ -22,6 +22,7 @@ support-files =
[browser_application_panel_list-domain-workers.js]
[browser_application_panel_list-several-workers.js]
[browser_application_panel_list-single-worker.js]
[browser_application_panel_list-workers-empty.js]
[browser_application_panel_list-unicode.js]
[browser_application_panel_open-links.js]
skip-if = true # Bug 1467256

Просмотреть файл

@ -0,0 +1,25 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Check that the application panel only displays service workers from the
* current domain.
*/
const EMPTY_URL = (URL_ROOT + "service-workers/empty.html");
add_task(async function() {
await enableApplicationPanel();
const { panel, tab } = await openNewTabAndApplicationPanel(EMPTY_URL);
const doc = panel.panelWin.document;
await waitUntil(() => doc.querySelector(".js-worker-list-empty") !== null);
ok(true, "No service workers are shown for an empty page");
// close the tab
info("Closing the tab.");
await BrowserTestUtils.removeTab(tab);
});