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 /accessible/tests/browser/e10s/browser_treeupdate_gencontent.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 'accessible/tests/browser/e10s/browser_treeupdate_gencontent.js')
-rw-r--r-- | accessible/tests/browser/e10s/browser_treeupdate_gencontent.js | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/accessible/tests/browser/e10s/browser_treeupdate_gencontent.js b/accessible/tests/browser/e10s/browser_treeupdate_gencontent.js new file mode 100644 index 000000000..126419288 --- /dev/null +++ b/accessible/tests/browser/e10s/browser_treeupdate_gencontent.js @@ -0,0 +1,78 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +'use strict'; + +/* global EVENT_REORDER */ + +loadScripts({ name: 'role.js', dir: MOCHITESTS_DIR }); + +addAccessibleTask(` + <style> + .gentext:before { + content: "START" + } + .gentext:after { + content: "END" + } + </style> + <div id="container1"></div> + <div id="container2"><div id="container2_child">text</div></div>`, + function*(browser, accDoc) { + const id1 = 'container1'; + const id2 = 'container2'; + let container1 = findAccessibleChildByID(accDoc, id1); + let container2 = findAccessibleChildByID(accDoc, id2); + + let tree = { + SECTION: [ ] // container + }; + testAccessibleTree(container1, tree); + + tree = { + SECTION: [ { // container2 + SECTION: [ { // container2 child + TEXT_LEAF: [ ] // primary text + } ] + } ] + }; + testAccessibleTree(container2, tree); + + let onReorder = waitForEvent(EVENT_REORDER, id1); + // Create and add an element with CSS generated content to container1 + yield ContentTask.spawn(browser, id1, id => { + let node = content.document.createElement('div'); + node.textContent = 'text'; + node.setAttribute('class', 'gentext'); + content.document.getElementById(id).appendChild(node); + }); + yield onReorder; + + tree = { + SECTION: [ // container + { SECTION: [ // inserted node + { STATICTEXT: [] }, // :before + { TEXT_LEAF: [] }, // primary text + { STATICTEXT: [] } // :after + ] } + ] + }; + testAccessibleTree(container1, tree); + + onReorder = waitForEvent(EVENT_REORDER, id2); + // Add CSS generated content to an element in container2's subtree + yield invokeSetAttribute(browser, 'container2_child', 'class', 'gentext'); + yield onReorder; + + tree = { + SECTION: [ // container2 + { SECTION: [ // container2 child + { STATICTEXT: [] }, // :before + { TEXT_LEAF: [] }, // primary text + { STATICTEXT: [] } // :after + ] } + ] + }; + testAccessibleTree(container2, tree); + }); |