diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/inspector/test/browser_inspector_remove-iframe-during-load.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/inspector/test/browser_inspector_remove-iframe-during-load.js')
-rw-r--r-- | devtools/client/inspector/test/browser_inspector_remove-iframe-during-load.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/devtools/client/inspector/test/browser_inspector_remove-iframe-during-load.js b/devtools/client/inspector/test/browser_inspector_remove-iframe-during-load.js new file mode 100644 index 000000000..2058b85fa --- /dev/null +++ b/devtools/client/inspector/test/browser_inspector_remove-iframe-during-load.js @@ -0,0 +1,48 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +// Testing that the inspector doesn't go blank when navigating to a page that +// deletes an iframe while loading. + +const TEST_URL = URL_ROOT + "doc_inspector_remove-iframe-during-load.html"; + +add_task(function* () { + let {inspector, testActor} = yield openInspectorForURL("about:blank"); + yield selectNode("body", inspector); + + // We do not want to wait for the inspector to be fully ready before testing + // so we load TEST_URL and just wait for the content window to be done loading + yield testActor.loadAndWaitForCustomEvent(TEST_URL); + + // The content doc contains a script that creates iframes and deletes them + // immediately after. It does this before the load event, after + // DOMContentLoaded and after load. This is what used to make the inspector go + // blank when navigating to that page. + // At this stage, there should be no iframes in the page anymore. + ok(!(yield testActor.hasNode("iframe")), + "Iframes added by the content page should have been removed"); + + // Create/remove an extra one now, after the load event. + info("Creating and removing an iframe."); + let onMarkupLoaded = inspector.once("markuploaded"); + testActor.eval("new " + function () { + let iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + iframe.remove(); + }); + + ok(!(yield testActor.hasNode("iframe")), + "The after-load iframe should have been removed."); + + info("Waiting for markup-view to load."); + yield onMarkupLoaded; + + // Assert that the markup-view is displayed and works + ok(!(yield testActor.hasNode("iframe")), "Iframe has been removed."); + is((yield testActor.getProperty("#yay", "textContent")), "load", + "Load event fired."); + + yield selectNode("#yay", inspector); +}); |