Bug 1210671 - Avoid CPOW to create the test page in browser_inspector_initialization.js; r=miker

MozReview-Commit-ID: Jjq5SUWZTXa

--HG--
extra : rebase_source : 885ecd284c4dc3c82ab8229b677384af80781900
This commit is contained in:
Patrick Brosset 2016-05-17 12:51:44 +02:00
Родитель 6e33d93476
Коммит 044be2e517
1 изменённых файлов: 18 добавлений и 21 удалений

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

@ -8,29 +8,25 @@
// Tests for different ways to initialize the inspector.
const DOCUMENT_HTML = '<div id="first" style="{margin: 10em; font-size: 14pt;' +
'font-family: helvetica, sans-serif; color: #AAA}">\n' +
'<h1>Some header text</h1>\n' +
'<p id="salutation" style="{font-size: 12pt}">hi.</p>\n' +
'<p id="body" style="{font-size: 12pt}">I am a test-case. This text exists ' +
'solely to provide some things to test the inspector initialization.</p>\n' +
'If you are reading this, you should go do something else instead. Maybe ' +
'read a book. Or better yet, write some test-cases for another bit of code. ' +
'<span style="{font-style: italic}">Inspector\'s!</span></p>\n' +
'<p id="closing">end transmission</p>\n' +
'</div>';
const HTML = `
<div id="first" style="margin: 10em; font-size: 14pt;
font-family: helvetica, sans-serif; color: gray">
<h1>Some header text</h1>
<p id="salutation" style="font-size: 12pt">hi.</p>
<p id="body" style="font-size: 12pt">I am a test-case. This text exists
solely to provide some things to test the inspector initialization.</p>
<p>If you are reading this, you should go do something else instead. Maybe
read a book. Or better yet, write some test-cases for another bit of code.
<span style="font-style: italic">Inspector's!</span>
</p>
<p id="closing">end transmission</p>
</div>
`;
const TEST_URI = "data:text/html;charset=utf-8,test page";
const TEST_URI = "data:text/html;charset=utf-8," + encodeURI(HTML);
add_task(function* () {
let tab = yield addTab(TEST_URI);
content.document.body.innerHTML = DOCUMENT_HTML;
content.document.title = "Inspector Initialization Test";
let deferred = promise.defer();
executeSoon(deferred.resolve);
yield deferred.promise;
let testActor = yield getTestActorWithoutToolbox(tab);
yield testToolboxInitialization(tab);
@ -98,7 +94,7 @@ function* testMarkupView(selector, inspector) {
try {
is(inspector.selection.nodeFront, nodeFront,
"Right node is selected in the markup view");
} catch(ex) {
} catch (ex) {
ok(false, "Got exception while resolving selected node of markup view.");
console.error(ex);
}
@ -112,5 +108,6 @@ function* testBreadcrumbs(selector, inspector) {
let expectedText = b.prettyPrintNodeAsText(nodeFront);
let button = b.container.querySelector("button[checked=true]");
ok(button, "A crumbs is checked=true");
is(button.getAttribute("tooltiptext"), expectedText, "Crumb refers to the right node");
is(button.getAttribute("tooltiptext"), expectedText,
"Crumb refers to the right node");
}