diff --git a/devtools/client/aboutdebugging/initializer.js b/devtools/client/aboutdebugging/initializer.js index fb193ad18bed..f1b91f14d13b 100644 --- a/devtools/client/aboutdebugging/initializer.js +++ b/devtools/client/aboutdebugging/initializer.js @@ -24,8 +24,8 @@ const { require } = BrowserLoader({ window }); -const { createFactory, render, unmountComponentAtNode } = - require("devtools/client/shared/vendor/react"); +const { createFactory } = require("devtools/client/shared/vendor/react"); +const { render, unmountComponentAtNode } = require("devtools/client/shared/vendor/react-dom"); const AboutDebuggingApp = createFactory(require("./components/aboutdebugging")); diff --git a/devtools/client/aboutdebugging/test/browser_addons_reload.js b/devtools/client/aboutdebugging/test/browser_addons_reload.js index a9c81dfd02fa..506495a60cf3 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_reload.js +++ b/devtools/client/aboutdebugging/test/browser_addons_reload.js @@ -170,8 +170,8 @@ add_task(function* reloadButtonRefreshesMetadata() { // Wait for the add-on list to be updated with the reloaded name. const onReInstall = promiseAddonEvent("onInstalled"); - const onAddonReloaded = waitForMutation(getAddonList(document), - { childList: true, subtree: true }); + const onAddonReloaded = waitForContentMutation(getAddonList(document)); + const reloadButton = getReloadButton(document, manifestBase.name); reloadButton.click(); diff --git a/devtools/client/aboutdebugging/test/browser_tabs.js b/devtools/client/aboutdebugging/test/browser_tabs.js index c500bbc7f82c..8cdeef17d6bf 100644 --- a/devtools/client/aboutdebugging/test/browser_tabs.js +++ b/devtools/client/aboutdebugging/test/browser_tabs.js @@ -39,7 +39,7 @@ add_task(function* () { // Then wait for title update, but on slow test runner, the title may already // be set to the expected value if (newTabTarget.textContent != "foo") { - yield waitForMutation(newTabTarget, { childList: true }); + yield waitForContentMutation(newTabTarget); } // Check that the new tab appears in the UI diff --git a/devtools/client/aboutdebugging/test/head.js b/devtools/client/aboutdebugging/test/head.js index d52548538e7f..001d36e34961 100644 --- a/devtools/client/aboutdebugging/test/head.js +++ b/devtools/client/aboutdebugging/test/head.js @@ -3,7 +3,7 @@ /* eslint-env browser */ /* exported openAboutDebugging, changeAboutDebuggingHash, closeAboutDebugging, - installAddon, uninstallAddon, waitForMutation, assertHasTarget, + installAddon, uninstallAddon, waitForMutation, waitForContentMutation, assertHasTarget, getServiceWorkerList, getTabList, openPanel, waitForInitialAddonList, waitForServiceWorkerRegistered, unregisterServiceWorker, waitForDelayedStartupFinished, setupTestAboutDebuggingWebExtension, @@ -229,6 +229,22 @@ function waitForMutation(target, mutationOptions) { }); } +/** + * Returns a promise that will resolve after receiving a mutation in the subtree of the + * provided target. Depending on the current React implementation, a text change might be + * observable as a childList mutation or a characterData mutation. + * + * @param {Node} target + * @return {Promise} + */ +function waitForContentMutation(target) { + return waitForMutation(target, { + characterData: true, + childList: true, + subtree: true + }); +} + /** * Checks if an about:debugging TargetList element contains a Target element * corresponding to the specified name.