Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Unified Diff: LayoutTests/accessibility/loading-iframe-sends-notification.html

Issue 210253003: Make data: urls always parse async (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/accessibility/loading-iframe-sends-notification-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/loading-iframe-sends-notification.html
diff --git a/LayoutTests/accessibility/loading-iframe-sends-notification.html b/LayoutTests/accessibility/loading-iframe-sends-notification.html
index e133e9472656569e5029997a3952c7c8bfea065f..5ce8e0268b89d7d3c8948bae5ab2c4c708cb3d4e 100644
--- a/LayoutTests/accessibility/loading-iframe-sends-notification.html
+++ b/LayoutTests/accessibility/loading-iframe-sends-notification.html
@@ -20,51 +20,45 @@
if (window.testRunner)
testRunner.waitUntilDone();
+ else
+ debug("This test requires window.accessibilityController and must be run in content_shell with --dump-render-tree.")
window.jsTestIsAsync = true;
function runTest()
{
- window.gotIframeNotification = false;
-
if (window.accessibilityController) {
// Initially, the iframe should not be loaded, so we shouldn't be able to find this button.
- shouldBeFalse("accessibilityController.accessibleElementById('innerbutton') != null");
+ shouldBeUndefined("accessibilityController.accessibleElementById('innerbutton')");
window.accessibilityController.addNotificationListener(function (target, notification) {
- // Ignore this notification if it's not on the iframe.
- if (target.description.indexOf("InnerFrame") == -1)
+ if (!target.parentElement() || !target.parentElement().parentElement())
return;
- debug("Got notification on iframe.");
- gotIframeNotification = true;
+ // Ignore this notification if it's not within the subtree of the iframe.
+ var frameTarget = target.parentElement().parentElement();
+ if (frameTarget.description.indexOf("InnerFrame") == -1)
+ return;
- // Check that the button within the iframe is now reachable from the root.
- shouldBeTrue("accessibilityController.accessibleElementById('innerbutton') != null");
- });
- }
+ // Even still we'll get LayoutComplete notifications sooner than we want.
+ if (!accessibilityController.accessibleElementById('innerbutton'))
+ return;
- window.iframeElement = document.getElementById("iframe");
- iframeElement.addEventListener("load", function() {
- window.setTimeout(function() {
- shouldBeTrue("gotIframeNotification");
+ // Check that the button within the iframe is now reachable from the root.
+ shouldBeDefined("accessibilityController.accessibleElementById('innerbutton')");
if (window.accessibilityController)
accessibilityController.removeNotificationListener();
finishJSTest();
- }, 10);
- }, false);
+ });
+ }
// Load content into the iframe. This will trigger the event
// handler above, which will check that the accessibility tree
// was updated with new content.
- window.iframeElement.src = "data:text/html,<body><button id='innerbutton'>InnerButton</button></body>";
+ document.getElementById("iframe").src = "data:text/html,<body><button id='innerbutton'>InnerButton</button></body>";
}
-
- window.addEventListener('load', function() {
- setTimeout(runTest, 10);
- }, false);
-
+ window.addEventListener('load', runTest);
</script>
</body>
« no previous file with comments | « no previous file | LayoutTests/accessibility/loading-iframe-sends-notification-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698