Bug 1103993 - 4 - Cleanup styleinspector tests; r=bgrins

This commit is contained in:
Patrick Brosset 2014-12-10 09:09:25 +01:00
parent 1baa19bc8d
commit 1146fefa22
94 changed files with 96 additions and 103 deletions

View File

@ -6,7 +6,7 @@
// Tests that the checkbox to include browser styles works properly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,default styles test");
info("Creating the test document");

View File

@ -163,7 +163,7 @@ const TEST_DATA = [
}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {inspector, view} = yield openComputedView();

View File

@ -6,7 +6,7 @@
// Test computed view key bindings
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,default styles test");
info("Adding content to the test page");

View File

@ -6,7 +6,7 @@
// Tests the computed-view keyboard navigation
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,computed view keyboard nav test");
content.document.body.innerHTML = '<style type="text/css"> ' +

View File

@ -22,7 +22,7 @@ const TEST_URL = "data:text/html;charset=utf-8," + encodeURIComponent([
'</html>'
].join("\n"));
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openComputedView();

View File

@ -9,7 +9,7 @@
const {PropertyView} = devtools.require("devtools/styleinspector/computed-view");
const TEST_URI = TEST_URL_ROOT + "doc_matched_selectors.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openComputedView();

View File

@ -6,7 +6,7 @@
// Tests for matched selector texts in the computed view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,<div style='color:blue;'></div>");
info("Opening the computed view");

View File

@ -12,7 +12,7 @@ const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
let {PropertyView} = devtools.require("devtools/styleinspector/computed-view");
let {CssLogic} = devtools.require("devtools/styleinspector/css-logic");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openComputedView();

View File

@ -6,7 +6,7 @@
// Tests that the no results placeholder works properly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,no results placeholder test");
info("Creating the test document");

View File

@ -12,7 +12,7 @@ const PREF = "devtools.styleeditor.source-maps-enabled";
const SCSS_LOC = "doc_sourcemaps.scss:4";
const CSS_LOC = "doc_sourcemaps.css:1";
let test = asyncTest(function*() {
add_task(function*() {
info("Turning the pref " + PREF + " on");
Services.prefs.setBoolPref(PREF, true);

View File

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_pseudoelement.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openComputedView();

View File

@ -10,7 +10,7 @@
const TESTCASE_URI = 'data:text/html;charset=utf-8,' +
'<div id="testdiv" style="font-size:10px;">Test div!</div>';
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TESTCASE_URI);
info("Opening the computed view and selecting the test node");

View File

@ -6,7 +6,7 @@
// Tests that the search filter works properly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,default styles test");
info("Creating the test document");

View File

@ -10,7 +10,7 @@ XPCOMUtils.defineLazyGetter(this, "osString", function() {
return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
});
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,computed view copy test");
info("Creating the test document");

View File

@ -50,7 +50,7 @@ const DOCUMENT_URL = "data:text/html;charset=utf-8,"+encodeURIComponent(
'</body>',
'</html>'].join("\n"));
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(DOCUMENT_URL);
info("Opening the computed-view");

View File

@ -9,7 +9,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_content_stylesheet.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let target = getNode("#target");

View File

@ -19,7 +19,7 @@ let PAGE_CONTENT = [
'<div id="testid" class="testclass">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

View File

@ -16,7 +16,7 @@ let PAGE_CONTENT = [
'<div id="testid">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

View File

@ -6,7 +6,7 @@
// Test cancelling the addition of a new property in the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_ui.js");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -21,7 +21,7 @@ let PAGE_CONTENT = [
'<div id="testid" class="testclass">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

View File

@ -7,7 +7,7 @@
// Test all sorts of additions and updates of properties in the rule-view
// FIXME: TO BE SPLIT IN *MANY* SMALLER TESTS
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_ui.js");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -26,7 +26,7 @@ const TEST_DATA = [
{ node: "p", expected: "p" }
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");

View File

@ -17,7 +17,7 @@ let PAGE_CONTENT = [
'<span>This is a span</span>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");

View File

@ -17,7 +17,7 @@ let PAGE_CONTENT = [
'<span>This is a span</span>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");

View File

@ -17,7 +17,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -19,7 +19,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -18,7 +18,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -16,7 +16,7 @@ const PAGE_CONTENT = [
'Updating a gradient declaration with the color picker tooltip'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
info("Creating the test document");

View File

@ -18,7 +18,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -24,7 +24,7 @@ const PAGE_CONTENT = [
'<p>Testing the color picker tooltip!</p>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -37,7 +37,7 @@ const TESTS = [
{selector: "*", propertyName: "box-shadow", nb: 2},
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -55,7 +55,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<h1 style='border: 1px solid red'>Filename" +
": browser_bug893965_css_property_completion_existing_property.js</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -39,7 +39,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<h1 style='color: red'>Filename: " +
"browser_bug894376_css_value_completion_existing_property_value_pair.js</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -40,7 +40,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<h1 style='border: 1px solid red'>Filename:" +
"browser_bug893965_css_property_completion_new_property.js</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -42,7 +42,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<style>h1{border: 1px solid red}</style>" +
"<h1>Test element</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -6,7 +6,7 @@
// Test that the rule-view content is correct
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_content.js");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -18,7 +18,7 @@ const CONTENT = '<body style="color:red;">\
const STRINGS = Services.strings
.createBundle("chrome://global/locale/devtools/styleinspector.properties");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + CONTENT);
info("Getting the test element");

View File

@ -20,7 +20,7 @@ const PAGE_CONTENT = [
'<div class="test">Testing the cubic-bezier tooltip!</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view cubic-bezier tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'</style>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view cubic-bezier tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'</style>',
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view cubic-bezier tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -23,7 +23,7 @@ const testData = [
{value: "blue", commitKey: "VK_TAB", modifiers: {shiftKey: true}, expected: "blue"}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test escaping property change reverts back to original value");
info("Creating the test document");

View File

@ -7,7 +7,7 @@
// Test that increasing/decreasing values in rule view using
// arrow keys works correctly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,sample document for bug 722691");
createDocument();
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -6,7 +6,7 @@
// Checking properties orders and overrides in the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_manipulation.js");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -21,7 +21,7 @@ let PAGE_CONTENT = [
'<div id="testid" class="testclass">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
let tab = yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

View File

@ -6,7 +6,7 @@
// Test several types of rule-view property edition
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_ui.js");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -47,7 +47,7 @@ const TEST_DATA = [
}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test escaping selector change reverts back to original value");
info("Creating the test document");

View File

@ -16,7 +16,7 @@ let PAGE_CONTENT = [
'<span id="testid2">This is a span</span>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view selector changes");
info("Creating the test document");

View File

@ -22,7 +22,7 @@ let PAGE_CONTENT = [
'<div id="testid3">B</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view selector changes");
info("Creating the test document");

View File

@ -33,7 +33,7 @@ const EXPECTED_COLOR = "rgb(255, 255, 85)"; // #ff5
// Test opening the eyedropper from the color picker. Pressing escape
// to close it, and clicking the page to select a color.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view eyedropper test");
content.document.body.innerHTML = PAGE_CONTENT;

View File

@ -8,7 +8,7 @@
let {ELEMENT_STYLE} = devtools.require("devtools/server/actors/styles");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_inspector_changes.js");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -7,7 +7,7 @@
// Test that focus doesn't leave the style editor when adding a property
// (bug 719916)
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,<h1>Some header text</h1>");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_keyframeanimation.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -9,7 +9,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_keyframeanimation.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -22,7 +22,7 @@ const TEST_DATA = [
{escape: true, value: "inline", expected: "block"}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view live preview on user changes");
let style = '#testid {display:block;}';

View File

@ -25,7 +25,7 @@ const TEST_URL = [
"</div>"
].join("");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -9,7 +9,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();

View File

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -12,7 +12,7 @@ const PREF = "devtools.styleeditor.source-maps-enabled";
const SCSS_LOC = "doc_sourcemaps.scss:4";
const CSS_LOC = "doc_sourcemaps.css:1";
let test = asyncTest(function*() {
add_task(function*() {
info("Setting the " + PREF + " pref to true");
Services.prefs.setBoolPref(PREF, true);

View File

@ -6,7 +6,7 @@
// Test the display of overridden declarations in the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_override.js");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_pseudoelement.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_pseudoelement.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -6,7 +6,7 @@
// Test that changing the current element's attributes refreshes the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_refresh-on-attribute-change.js");
info("Preparing the test document and node");

View File

@ -6,7 +6,7 @@
// Test that changing the current element's style attribute refreshes the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_update.js");
content.document.body.innerHTML = '<div id="testid" class="testclass">Styled Node</div>';

View File

@ -10,7 +10,7 @@
const TESTCASE_URI = 'data:text/html;charset=utf-8,' +
'<div id="testdiv" style="font-size:10px;">Test div!</div>';
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TESTCASE_URI);
Services.prefs.setCharPref("devtools.defaultColorUnit", "name");

View File

@ -10,7 +10,7 @@ XPCOMUtils.defineLazyGetter(this, "osString", function() {
return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
});
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,<p>rule view context menu test</p>");
info("Creating the test document");

View File

@ -18,7 +18,7 @@ const PAGE_CONTENT = [
let TYPE = "SelectorHighlighter";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {view: rView} = yield openRuleView();

View File

@ -24,7 +24,7 @@ const PAGE_CONTENT = [
const TYPE = "SelectorHighlighter";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {inspector, view: rView} = yield openRuleView();

View File

@ -54,7 +54,7 @@ const DOCUMENT_URL = "data:text/html;charset=utf-8,"+encodeURIComponent(
'</body>',
'</html>'].join("\n"));
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(DOCUMENT_URL);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -10,7 +10,7 @@ const TEST_URI = TEST_URL_ROOT + "doc_urls_clickable.html";
const TEST_IMAGE = TEST_URL_ROOT + "doc_test_image.png";
const BASE_64_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();
yield selectNodes(inspector, view);

View File

@ -15,7 +15,7 @@ const TEST_URI = "data:text/html;charset=utf-8," +
" </pre>" +
"</blockquote>";
let test = asyncTest(function*() {
add_task(function*() {
info ("Starting the test with the pref set to true before toolbox is opened");
Services.prefs.setBoolPref(PREF_UA_STYLES, true);

View File

@ -16,7 +16,7 @@ const TEST_URI = "data:text/html;charset=utf-8," +
" </pre>" +
"</blockquote>";
let test = asyncTest(function*() {
add_task(function*() {
info ("Starting the test with the pref set to true before toolbox is opened");
yield setUserAgentStylesPref(true);

View File

@ -13,7 +13,7 @@ let TEST_PAGE = [
"<p id='id2' style='width:100px;'>element 2</p>"
].join("");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_PAGE);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -8,7 +8,7 @@
const TEST_COLOR = "#123ABC";
const COLOR_SELECTOR = "span[data-color]";
let test = asyncTest(function* () {
add_task(function* () {
const TEST_DOC = '<html> \
<body> \
<div style="color: ' + TEST_COLOR + '; \

View File

@ -8,7 +8,7 @@
const TEST_COLOR = "#123ABC";
let test = asyncTest(function* () {
add_task(function* () {
const PAGE_CONTENT = [
'<style type="text/css">',
' div {',

View File

@ -18,7 +18,7 @@ const XUL_PRINCIPAL = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager)
.getNoAppCodebasePrincipal(XUL_URI);
let test = asyncTest(function*() {
add_task(function*() {
info("Checking stylesheets on HTML document");
yield addTab(TEST_URI_HTML);
let target = getNode("#target");

View File

@ -10,7 +10,7 @@ const TEST_URL = 'data:text/html;charset=utf-8,' +
'<div id="one" style="color:red;">one</div>' +
'<div id="two" style="color:blue;">two</div>';
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
info("Opening the rule-view and selecting test node one");

View File

@ -25,7 +25,7 @@ const PAGE_CONTENT = [
'<div class="test-element">test element</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -6,7 +6,7 @@
// Test that if a tooltip is visible when a new selection is made, it closes
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,<div class='one'>el 1</div><div class='two'>el 2</div>");
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -17,7 +17,7 @@ const PAGE_CONTENT = [
'<div id="testElement">test element</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,font family longhand tooltip test");
info("Creating the test document");

View File

@ -16,7 +16,7 @@ let BLUE_DOT = "data:image/png;base64," +
"BIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gYcDCwlCkCM9QAAABl0RVh0Q29tbWVudABDcmVh" +
"dGVkIHdpdGggR0lNUFeBDhcAAAANSURBVAjXY2Bg+F8PAAKCAX/tPkrkAAAAAElFTkSuQmCC";
let test = asyncTest(function* () {
add_task(function* () {
let TEST_STYLE = "h1 {background: url(" + YELLOW_DOT + "), url(" + BLUE_DOT + ");}";
let PAGE_CONTENT = "<style>" + TEST_STYLE + "</style>" +

View File

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'<div id="testElement">test element</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,font family shorthand tooltip test");
info("Creating the test document");

View File

@ -18,7 +18,7 @@ const TEST_PAGE = [
'<div></div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_PAGE);
let {toolbox, inspector, view} = yield openRuleView();

View File

@ -17,7 +17,7 @@ const PAGE_CONTENT = [
const TYPE = "CssTransformHighlighter";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {inspector, view: rView} = yield openRuleView();

View File

@ -19,7 +19,7 @@ const PAGE_CONTENT = [
let TYPE = "CssTransformHighlighter";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {inspector, view: rView} = yield openRuleView();

View File

@ -25,7 +25,7 @@ const PAGE_CONTENT = [
const TYPE = "CssTransformHighlighter";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {inspector, view: rView} = yield openRuleView();

View File

@ -27,7 +27,7 @@ const PAGE_CONTENT = [
const TYPE = "CssTransformHighlighter";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {view: rView, inspector} = yield openRuleView();

View File

@ -57,7 +57,7 @@ registerCleanupFunction(() => {
*
* All tests should follow the following pattern:
*
* let test = asyncTest(function*() {
* add_task(function*() {
* yield addTab(TEST_URI);
* let {toolbox, inspector, view} = yield openComputedView();
*
@ -84,17 +84,10 @@ registerCleanupFunction(() => {
* UTILS
* *********************************************
* General test utilities.
* Define the test case, add new tabs, open the toolbox and switch to the
* various panels, select nodes, get node references, ...
* Add new tabs, open the toolbox and switch to the various panels, select
* nodes, get node references, ...
*/
/**
* Define an async test based on a generator function
*/
function asyncTest(generator) {
return () => Task.spawn(generator).then(null, ok.bind(null, false)).then(finish);
}
/**
* Add a new test tab in the browser and load the given url.
* @param {String} url The url to be loaded in the new tab