diff options
Diffstat (limited to 'devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_cross_domain_iframe.js')
-rw-r--r-- | devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_cross_domain_iframe.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_cross_domain_iframe.js b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_cross_domain_iframe.js new file mode 100644 index 0000000000..157d5825ef --- /dev/null +++ b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_cross_domain_iframe.js @@ -0,0 +1,28 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +// Test to see if retrieving cached messages in a page with a cross-domain iframe does +// not crash the console. + +"use strict"; + +const TEST_URI = + "http://example.com/browser/devtools/client/webconsole/" + + "test/browser/test-iframe-parent.html"; + +add_task(async function () { + // test-iframe-parent has an iframe pointing to http://mochi.test:8888/browser/devtools/client/webconsole/test/browser/test-iframe-child.html + info("Open the tab first"); + await addTab(TEST_URI); + + info("Evaluate an expression that will throw, so we'll have cached messages"); + await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function () { + content.wrappedJSObject.document.querySelector("button").click(); + }); + + info("Then open the console, to retrieve cached messages"); + await openConsole(); + + // TODO: Make the test fail without the fix. + ok(true, "Everything is okay"); +}); |