From 024c25abe1ccdb30c18b25587a710f83550a757b Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Mon, 7 Jun 2021 16:30:42 +0000 Subject: [PATCH] Bug 1714994 - [devtools] Remove testActor from runEditOuterHTMLTests r=nchevobbe Depends on D116965 Differential Revision: https://phabricator.services.mozilla.com/D117001 --- .../markup/test/browser_markup_html_edit_01.js | 4 ++-- .../markup/test/browser_markup_html_edit_02.js | 14 +++++++------- .../markup/test/helper_outerhtml_test_runner.js | 9 +++------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/devtools/client/inspector/markup/test/browser_markup_html_edit_01.js b/devtools/client/inspector/markup/test/browser_markup_html_edit_01.js index a83fe80f80c8..52e629c599d1 100644 --- a/devtools/client/inspector/markup/test/browser_markup_html_edit_01.js +++ b/devtools/client/inspector/markup/test/browser_markup_html_edit_01.js @@ -105,7 +105,7 @@ const TEST_URL = ""; add_task(async function() { - const { inspector, testActor } = await openInspectorForURL(TEST_URL); + const { inspector } = await openInspectorForURL(TEST_URL); inspector.markup._frame.focus(); - await runEditOuterHTMLTests(TEST_DATA, inspector, testActor); + await runEditOuterHTMLTests(TEST_DATA, inspector); }); diff --git a/devtools/client/inspector/markup/test/browser_markup_html_edit_02.js b/devtools/client/inspector/markup/test/browser_markup_html_edit_02.js index 16db70bd5fdf..ccda537d2478 100644 --- a/devtools/client/inspector/markup/test/browser_markup_html_edit_02.js +++ b/devtools/client/inspector/markup/test/browser_markup_html_edit_02.js @@ -13,7 +13,7 @@ const TEST_DATA = [ selector: "#badMarkup1", oldHTML: '
badMarkup1
', newHTML: '
badMarkup1
hanging', - validate: async function({ pageNodeFront, selectedNodeFront, testActor }) { + validate: async function({ pageNodeFront, selectedNodeFront }) { is(pageNodeFront, selectedNodeFront, "Original element is selected"); const [textNodeName, textNodeData] = await SpecialPowers.spawn( @@ -35,7 +35,7 @@ const TEST_DATA = [ newHTML: '
badMarkup2
hanging
' + "", - validate: async function({ pageNodeFront, selectedNodeFront, testActor }) { + validate: async function({ pageNodeFront, selectedNodeFront }) { is(pageNodeFront, selectedNodeFront, "Original element is selected"); const [textNodeName, textNodeData] = await SpecialPowers.spawn( @@ -57,7 +57,7 @@ const TEST_DATA = [ newHTML: '
badMarkup3 Emphasized ' + "and strong
", - validate: async function({ pageNodeFront, selectedNodeFront, testActor }) { + validate: async function({ pageNodeFront, selectedNodeFront }) { is(pageNodeFront, selectedNodeFront, "Original element is selected"); const emText = await getContentPageElementProperty( @@ -76,7 +76,7 @@ const TEST_DATA = [ selector: "#badMarkup4", oldHTML: '
badMarkup4
', newHTML: '
badMarkup4

', - validate: async function({ pageNodeFront, selectedNodeFront, testActor }) { + validate: async function({ pageNodeFront, selectedNodeFront }) { is(pageNodeFront, selectedNodeFront, "Original element is selected"); const divText = await getContentPageElementProperty( @@ -107,7 +107,7 @@ const TEST_DATA = [ selector: "#badMarkup5", oldHTML: '

badMarkup5

', newHTML: '

badMarkup5

with a nested div

', - validate: async function({ pageNodeFront, selectedNodeFront, testActor }) { + validate: async function({ pageNodeFront, selectedNodeFront }) { is(pageNodeFront, selectedNodeFront, "Original element is selected"); const num = await getNumberOfMatchingElementsInContentPage( @@ -151,7 +151,7 @@ const TEST_URL = ""; add_task(async function() { - const { inspector, testActor } = await openInspectorForURL(TEST_URL); + const { inspector } = await openInspectorForURL(TEST_URL); inspector.markup._frame.focus(); - await runEditOuterHTMLTests(TEST_DATA, inspector, testActor); + await runEditOuterHTMLTests(TEST_DATA, inspector); }); diff --git a/devtools/client/inspector/markup/test/helper_outerhtml_test_runner.js b/devtools/client/inspector/markup/test/helper_outerhtml_test_runner.js index 04893ab4b54e..45475d01c59d 100644 --- a/devtools/client/inspector/markup/test/helper_outerhtml_test_runner.js +++ b/devtools/client/inspector/markup/test/helper_outerhtml_test_runner.js @@ -16,14 +16,13 @@ * @param {Array} tests See runEditOuterHTMLTest for the structure * @param {InspectorPanel} inspector The instance of InspectorPanel currently * opened - * @param {TestActorFront} testActor The current TestActorFront instance * @return a promise that resolves when the tests have run */ -function runEditOuterHTMLTests(tests, inspector, testActor) { +function runEditOuterHTMLTests(tests, inspector) { info("Running " + tests.length + " edit-outer-html tests"); return (async function() { for (const step of tests) { - await runEditOuterHTMLTest(step, inspector, testActor); + await runEditOuterHTMLTest(step, inspector); } })(); } @@ -39,10 +38,9 @@ function runEditOuterHTMLTests(tests, inspector, testActor) { * after the new outer-html has been inserted. Should be used to verify * the actual DOM, see if it corresponds to the newHTML string provided * @param {InspectorPanel} inspector The instance of InspectorPanel currently - * @param {TestActorFront} testActor The current TestActorFront instance * opened */ -async function runEditOuterHTMLTest(test, inspector, testActor) { +async function runEditOuterHTMLTest(test, inspector) { info("Running an edit outerHTML test on '" + test.selector + "'"); await selectNode(test.selector, inspector); @@ -70,7 +68,6 @@ async function runEditOuterHTMLTest(test, inspector, testActor) { pageNodeFront, selectedNodeFront, inspector, - testActor, }); } else { is(