blob: 8cd5f8fd88a1e08c33471acac71a2321e10346f8 [file] [log] [blame] [edit]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ runSingly=true AccessibilityTextStitchingEnabled=true ] -->
<html>
<head>
<script src="../resources/accessibility-helper.js"></script>
<script src="../resources/js-test.js"></script>
</head>
<body>
<div role="presentation" id="container">
<span>Hello</span>
</div>
<script>
var output = "This test ensures we maintain proper text stitching (or lack thereof) when the page changes dynamically\n\n";
if (window.accessibilityController) {
window.jsTestIsAsync = true;
var webArea = accessibilityController.rootElement.childAtIndex(0);
var text = webArea.childAtIndex(0);
output += expect("platformStaticTextValue(text).includes('Hello')", "true")
document.getElementById("container").insertAdjacentHTML("beforeend", " <span id='inner-span'>world</span>");
setTimeout(async function() {
output += await expectAsync("platformStaticTextValue(text).includes('Hello world')", "true")
document.getElementById("inner-span").insertAdjacentHTML("beforeend", " <span> last <span>text</span> </span>");
output += await expectAsync("platformStaticTextValue(text).includes('Hello world last text')", "true")
debug(output);
finishJSTest();
}, 0);
}
</script>
</body>
</html>