mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
22
parser/htmlparser/tests/mochitest/browser_viewsource.js
Normal file
22
parser/htmlparser/tests/mochitest/browser_viewsource.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
|
||||
add_task(function*() {
|
||||
const PAGE_URL = getRootDirectory(gTestPath) + "file_viewsource.html";
|
||||
let viewSourceTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "view-source:" + PAGE_URL);
|
||||
|
||||
let xhrPromise = new Promise(resolve => {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", PAGE_URL, true);
|
||||
xhr.onload = event => resolve(event.target.responseText);
|
||||
xhr.send();
|
||||
});
|
||||
|
||||
let viewSourceContentPromise = ContentTask.spawn(viewSourceTab.linkedBrowser, null, function*() {
|
||||
return content.document.body.textContent;
|
||||
});
|
||||
|
||||
let results = yield Promise.all([viewSourceContentPromise, xhrPromise]);
|
||||
is(results[0], results[1], "Sources should match");
|
||||
yield BrowserTestUtils.removeTab(viewSourceTab);
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue