4 Test that the inspector actor emits "resize" events when the page is resized.
5 https://bugzilla.mozilla.org/show_bug.cgi?id=1222409
9 <title>Test for Bug
1222409</title>
10 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css">
12 <script type=
"application/javascript" src=
"inspector-helpers.js"></script>
13 <script type=
"application/javascript">
16 window.onload = function() {
17 SimpleTest.waitForExplicitFinish();
22 addAsyncTest(async function setup() {
23 info(
"Setting up inspector and walker actors.");
25 const url = document.getElementById(
"inspectorContent").href;
27 const { target, doc } = await attachURL(url);
28 inspector = await target.getFront(
"inspector");
29 win = doc.defaultView;
33 addAsyncTest(async function() {
34 const walker = inspector.walker;
36 // We can't receive events from the walker if we haven't first executed a
37 // method on the actor to initialize it.
38 await walker.querySelector(walker.rootNode,
"img");
40 const {outerWidth, outerHeight} = win;
41 // eslint-disable-next-line new-cap
42 const onResize = new Promise(resolve =
> {
43 walker.once(
"resize", () =
> {
47 win.resizeTo(
800,
600);
50 ok(true,
"The resize event was emitted");
51 win.resizeTo(outerWidth, outerHeight);
61 <a id=
"inspectorContent" target=
"_blank" href=
"inspector-search-data.html">Test Document
</a>
63 <div id=
"content" style=
"display: none">