Bug 1440537 - Fix an a11y test to not rely on flushing the parent document layout across docgroup boundaries. r=surkov
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 20 Apr 2019 18:13:42 +0200
changeset 471650 e7be3478e08c069f9ea50173654a9a5abe3caf6e
parent 471649 08d39c306ffbbb2d5f9cb645e3a4103f2656aaa9
child 471651 40ccb621b5d137feb6d7f82eb2b7facd8d8f837f
push id112933
push userrmaries@mozilla.com
push dateSat, 27 Apr 2019 21:51:53 +0000
treeherdermozilla-inbound@5257cabf18a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1440537
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1440537 - Fix an a11y test to not rely on flushing the parent document layout across docgroup boundaries. r=surkov We're going to stop propagating these flushes up since they're not observable by content and it matches what would happen in a fission world. This test relies on the parent document layout tree being up-to-date by the time we run the iframe load handler. Also improve diagnostics in the case the assertion fails. Differential Revision: https://phabricator.services.mozilla.com/D28300
accessible/tests/mochitest/aom/test_general.html
--- a/accessible/tests/mochitest/aom/test_general.html
+++ b/accessible/tests/mochitest/aom/test_general.html
@@ -32,16 +32,18 @@
   // global, so we need to create an iframe to see the effects of calling
   // enablePref().
   function createIframe() {
     return new Promise((resolve) => {
       let iframe = document.createElement("iframe");
       iframe.src = `data:text/html,<html><body>hey</body></html>`;
       iframe.onload = () => resolve(iframe.contentDocument);
       document.body.appendChild(iframe);
+      document.body.offsetTop; // We rely on the a11y tree being created
+                               // already, and it's created off layout.
     });
   }
 
   function testStringProp(anode, prop) {
     is(anode[prop], null, `anode.${prop} should be null`);
     let text = "This is a string test";
     anode[prop] = text;
     is(anode[prop], text, `anode.${prop} was assigned "${text}"`);
@@ -113,17 +115,17 @@
         ];
         break;
       case 7:
         states = [
           "readonly", "busy", "focusable", "opaque", "stale", "enabled", "sensitive",
         ];
         break;
       default:
-        ok(false, "Unexpected amount of states");
+        ok(false, "Unexpected amount of states: " + JSON.stringify(anode.states));
     }
     if (states) {
       for (let i = 0; i < states.length; i++) {
         is(anode.states[i], states[i], `${states[i]} state is expected at ${i}th index`);
       }
     }
 
     ok(anode.is("document", "focusable"),