Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: !debug && os == 'win' OR os == 'linux' && os_version == '18.04'
- Manifest: devtools/client/styleeditor/test/browser.toml
/* Any copyright is dedicated to the Public Domain.
"use strict";
// Test that sheets inside cross origin iframes, served from a service worker
// are correctly fetched via the service worker in the stylesheet editor.
add_task(async function () {
const TEST_URL =
const { ui } = await openStyleEditorForURL(TEST_URL);
if (ui.editors.length != 1) {
info("Stylesheet isn't available immediately, waiting for it");
await ui.once("editor-added");
}
is(ui.editors.length, 1, "Got the iframe stylesheet");
await ui.selectStyleSheet(ui.editors[0].styleSheet);
const editor = await ui.editors[0].getSourceEditor();
const text = editor.sourceEditor.getText();
is(
text,
"* { color: green; }",
"stylesheet content is the one served by the service worker"
);
});