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

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

Issue 40513003: Delete/move the remaining stale tests in TestExpectations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: delete plugins/reentrant-update-widget-positions.html as well Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7
8 <p>Before</p>
9
10 <iframe id="iframe" title="InnerFrame"></iframe>
11
12 <p>After</p>
13
14 <p>End of test</p>
15
16 <p id="description"></p>
17 <div id="console"></div>
18
19 <script>
20 description("This tests that when an iframe finishes loading, it sends a not ification.");
21
22 if (window.testRunner)
23 testRunner.waitUntilDone();
24
25 window.jsTestIsAsync = true;
26
27 // Recursively search the entire accessibility tree starting at the given
28 // AccessibilityUIElement (inclusive) and return the element whose title
29 // contains the given string. This makes it possible to find a node even
30 // when there are platform differences in the tree, i.e. due to different
31 // nodes being ignored.
32 function findByAccessibleTitleSubstring(startElement, titleSubstring)
33 {
34 if (startElement.title.indexOf(titleSubstring) >= 0)
35 return startElement;
36
37 for (var i = 0; i < startElement.childrenCount; i++) {
38 var found = findByAccessibleTitleSubstring(startElement.childAtIndex (i), titleSubstring);
39 if (found)
40 return found;
41 }
42
43 return null;
44 }
45
46 function runTest()
47 {
48 window.gotIframeNotification = false;
49
50 if (window.accessibilityController) {
51 window.root = accessibilityController.rootElement;
52
53 // Initially, the iframe should not be loaded, so we shouldn't be ab le to find this button.
54 shouldBeFalse("findByAccessibleTitleSubstring(root, 'InnerButton') ! = null");
55
56 window.accessibilityController.addNotificationListener(function (tar get, notification) {
57 // Ignore this notification if it's not on the iframe.
58 if (target.description.indexOf("InnerFrame") == -1)
59 return;
60
61 debug("Got notification on iframe.");
62 gotIframeNotification = true;
63
64 // Check that the button within the iframe is now reachable from the root.
65 shouldBeTrue("findByAccessibleTitleSubstring(root, 'InnerButton' ) != null");
66 });
67 }
68
69 window.iframeElement = document.getElementById("iframe");
70 iframeElement.addEventListener("load", function() {
71 window.setTimeout(function() {
72 shouldBeTrue("gotIframeNotification");
73 if (window.accessibilityController)
74 accessibilityController.removeNotificationListener();
75
76 finishJSTest();
77 }, 10);
78 }, false);
79
80 // Load content into the iframe. This will trigger the event
81 // handler above, which will check that the accessibility tree
82 // was updated with new content.
83 window.iframeElement.src = "data:text/html,<body><button>InnerButton</bu tton></body>";
84 }
85
86 window.addEventListener('load', function() {
87 setTimeout(runTest, 10);
88 }, false);
89
90 </script>
91
92 <script src="../fast/js/resources/js-test-post.js"></script>
93 </body>
94 </html>
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/lists.html ('k') | LayoutTests/accessibility/loading-iframe-sends-notification-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698