зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1246677 - 6 - Get rid of 'content' in ruleview head.js; r=tromey
MozReview-Commit-ID: A1r7oVz0cbV --HG-- extra : rebase_source : 05612546b89c8e524c5f3248295b28f0781e7b3a
This commit is contained in:
Родитель
26f78191e7
Коммит
e8c1fc396b
|
@ -58,13 +58,13 @@ const TEST_URI = "<h1 style='font: 24px serif'>Header</h1>";
|
||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||||
let {toolbox, inspector, view} = yield openRuleView();
|
let {toolbox, inspector, view, testActor} = yield openRuleView();
|
||||||
|
|
||||||
info("Test autocompletion after 1st page load");
|
info("Test autocompletion after 1st page load");
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
|
|
||||||
info("Test autocompletion after page navigation");
|
info("Test autocompletion after page navigation");
|
||||||
yield reloadPage(inspector);
|
yield reloadPage(inspector, testActor);
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ function* testCompletion([key, completion, index, total], editor, view) {
|
||||||
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
||||||
|
|
||||||
yield onSuggest;
|
yield onSuggest;
|
||||||
yield wait(1); // Equivalent of executeSoon
|
yield waitForTick();
|
||||||
|
|
||||||
info("Checking the state");
|
info("Checking the state");
|
||||||
if (completion != null) {
|
if (completion != null) {
|
||||||
|
|
|
@ -40,13 +40,13 @@ const TEST_URI = "<h1 style='color: red'>Header</h1>";
|
||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||||
let {toolbox, inspector, view} = yield openRuleView();
|
let {toolbox, inspector, view, testActor} = yield openRuleView();
|
||||||
|
|
||||||
info("Test autocompletion after 1st page load");
|
info("Test autocompletion after 1st page load");
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
|
|
||||||
info("Test autocompletion after page navigation");
|
info("Test autocompletion after page navigation");
|
||||||
yield reloadPage(inspector);
|
yield reloadPage(inspector, testActor);
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ function* testCompletion([key, modifiers, completion, index, total], editor,
|
||||||
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
||||||
|
|
||||||
yield onKeyPress;
|
yield onKeyPress;
|
||||||
yield wait(1); // Equivalent of executeSoon
|
yield waitForTick();
|
||||||
|
|
||||||
// The key might have been a TAB or shift-TAB, in which case the editor will
|
// The key might have been a TAB or shift-TAB, in which case the editor will
|
||||||
// be a new one
|
// be a new one
|
||||||
|
|
|
@ -41,13 +41,13 @@ const TEST_URI = "<h1 style='border: 1px solid red'>Header</h1>";
|
||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||||
let {toolbox, inspector, view} = yield openRuleView();
|
let {toolbox, inspector, view, testActor} = yield openRuleView();
|
||||||
|
|
||||||
info("Test autocompletion after 1st page load");
|
info("Test autocompletion after 1st page load");
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
|
|
||||||
info("Test autocompletion after page navigation");
|
info("Test autocompletion after page navigation");
|
||||||
yield reloadPage(inspector);
|
yield reloadPage(inspector, testActor);
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ function* testCompletion([key, completion, index, total], editor, view) {
|
||||||
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
||||||
|
|
||||||
yield onSuggest;
|
yield onSuggest;
|
||||||
yield wait(1); // Equivalent of executeSoon
|
yield waitForTick();
|
||||||
|
|
||||||
info("Checking the state");
|
info("Checking the state");
|
||||||
if (completion != null) {
|
if (completion != null) {
|
||||||
|
|
|
@ -50,13 +50,13 @@ const TEST_URI = `
|
||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||||
let {toolbox, inspector, view} = yield openRuleView();
|
let {toolbox, inspector, view, testActor} = yield openRuleView();
|
||||||
|
|
||||||
info("Test autocompletion after 1st page load");
|
info("Test autocompletion after 1st page load");
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
|
|
||||||
info("Test autocompletion after page navigation");
|
info("Test autocompletion after page navigation");
|
||||||
yield reloadPage(inspector);
|
yield reloadPage(inspector, testActor);
|
||||||
yield runAutocompletionTest(toolbox, inspector, view);
|
yield runAutocompletionTest(toolbox, inspector, view);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ function* testCompletion([key, modifiers, completion, index, total], editor,
|
||||||
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
||||||
|
|
||||||
yield onKeyPress;
|
yield onKeyPress;
|
||||||
yield wait(1); // Equivalent of executeSoon
|
yield waitForTick();
|
||||||
|
|
||||||
info("Checking the state");
|
info("Checking the state");
|
||||||
if (completion != null) {
|
if (completion != null) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ const TEST_URI = "<h1 style='font: 24px serif'></h1>";
|
||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||||
let {inspector, view} = yield openRuleView();
|
let {inspector, view, testActor} = yield openRuleView();
|
||||||
|
|
||||||
info("Test autocompletion popup is hidden after page navigation");
|
info("Test autocompletion popup is hidden after page navigation");
|
||||||
|
|
||||||
|
@ -28,12 +28,12 @@ add_task(function*() {
|
||||||
|
|
||||||
info("Waiting for autocomplete popup to be displayed");
|
info("Waiting for autocomplete popup to be displayed");
|
||||||
yield onSuggest;
|
yield onSuggest;
|
||||||
yield wait(1);
|
yield waitForTick();
|
||||||
|
|
||||||
ok(view.popup && view.popup.isOpen, "Popup should be opened");
|
ok(view.popup && view.popup.isOpen, "Popup should be opened");
|
||||||
|
|
||||||
info("Reloading the page");
|
info("Reloading the page");
|
||||||
yield reloadPage(inspector);
|
yield reloadPage(inspector, testActor);
|
||||||
|
|
||||||
ok(!(view.popup && view.popup.isOpen), "Popup should be closed");
|
ok(!(view.popup && view.popup.isOpen), "Popup should be closed");
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,7 +14,7 @@ const TEST_URI = `
|
||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||||
let {inspector, view} = yield openRuleView();
|
let {inspector, view, testActor} = yield openRuleView();
|
||||||
|
|
||||||
yield selectNode("#id1", inspector);
|
yield selectNode("#id1", inspector);
|
||||||
yield modifyRuleViewWidth("300px", view, inspector);
|
yield modifyRuleViewWidth("300px", view, inspector);
|
||||||
|
@ -25,7 +25,7 @@ add_task(function*() {
|
||||||
yield modifyRuleViewWidth("50px", view, inspector);
|
yield modifyRuleViewWidth("50px", view, inspector);
|
||||||
yield assertRuleAndMarkupViewWidth("id2", "50px", view, inspector);
|
yield assertRuleAndMarkupViewWidth("id2", "50px", view, inspector);
|
||||||
|
|
||||||
yield reloadPage(inspector);
|
yield reloadPage(inspector, testActor);
|
||||||
|
|
||||||
yield selectNode("#id1", inspector);
|
yield selectNode("#id1", inspector);
|
||||||
yield assertRuleAndMarkupViewWidth("id1", "200px", view, inspector);
|
yield assertRuleAndMarkupViewWidth("id1", "200px", view, inspector);
|
||||||
|
|
|
@ -110,20 +110,6 @@ function waitForNEvents(target, eventName, numTimes, useCapture = false) {
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This shouldn't be used in the tests, but is useful when writing new tests or
|
|
||||||
* debugging existing tests in order to introduce delays in the test steps
|
|
||||||
*
|
|
||||||
* @param {Number} ms
|
|
||||||
* The time to wait
|
|
||||||
* @return A promise that resolves when the time is passed
|
|
||||||
*/
|
|
||||||
function wait(ms) {
|
|
||||||
let def = promise.defer();
|
|
||||||
content.setTimeout(def.resolve, ms);
|
|
||||||
return def.promise;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wait for a content -> chrome message on the message manager (the window
|
* Wait for a content -> chrome message on the message manager (the window
|
||||||
* messagemanager is used).
|
* messagemanager is used).
|
||||||
|
@ -750,15 +736,14 @@ var setSearchFilter = Task.async(function*(view, searchValue) {
|
||||||
*
|
*
|
||||||
* @param {InspectorPanel} inspector
|
* @param {InspectorPanel} inspector
|
||||||
* The instance of InspectorPanel currently loaded in the toolbox
|
* The instance of InspectorPanel currently loaded in the toolbox
|
||||||
* @return a promise that resolves after page reload and inspector
|
* @param {TestActor} testActor
|
||||||
* initialization
|
* The current instance of the TestActor
|
||||||
*/
|
*/
|
||||||
function reloadPage(inspector) {
|
function* reloadPage(inspector, testActor) {
|
||||||
let onNewRoot = inspector.once("new-root");
|
let onNewRoot = inspector.once("new-root");
|
||||||
content.location.reload();
|
yield testActor.eval("content.location.reload();");
|
||||||
return onNewRoot.then(() => {
|
yield onNewRoot;
|
||||||
inspector.markup._waitForChildren();
|
yield inspector.markup._waitForChildren();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Загрузка…
Ссылка в новой задаче