Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
-
CI results over the last 21 days1,903Runs99.95%Pass1Failures0Timeouts0Crashes0Skips
Runs with issues per day (up to 0.2%) Sep 29Oct 19- Failures
- Manifest: browser/base/content/test/browser-siteIdentity/browser.toml
/* Any copyright is dedicated to the Public Domain.
"use strict";
const TEST_URL =
getRootDirectory(gTestPath).replace(
) + "dummy_page.html?a=1&b=2";
add_task(async function test_drag_identity_box_data() {
await BrowserTestUtils.withNewTab(TEST_URL, async () => {
let url = gBrowser.currentURI.displaySpec;
Assert.ok(url.includes("&"), "The URL contains an ampersand");
let dataTransfer = new DataTransfer();
document
.getElementById("identity-box")
.dispatchEvent(
new DragEvent("dragstart", { dataTransfer, bubbles: true })
);
let escapedURL = url.replaceAll("&", "&");
Assert.equal(
dataTransfer.getData("text/html"),
`<a href="${escapedURL}">${escapedURL}</a>`,
"Should set the expected text/html drag data"
);
Assert.equal(
dataTransfer.getData("text/plain"),
url,
"Should set the expected text/plain drag data"
);
});
});