Title: [188901] trunk/LayoutTests
Revision
188901
Author
commit-qu...@webkit.org
Date
2015-08-24 18:48:18 -0700 (Mon, 24 Aug 2015)

Log Message

AX: Fix accessibility/mac/search-with-frames.html test
https://bugs.webkit.org/show_bug.cgi?id=148313

Patch by Nan Wang <n_w...@apple.com> on 2015-08-24
Reviewed by Chris Fleizach.

Fixed the test by making sure that search is performed after all frames
have been loaded.

* accessibility/mac/search-with-frames.html:
* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (188900 => 188901)


--- trunk/LayoutTests/ChangeLog	2015-08-25 01:22:31 UTC (rev 188900)
+++ trunk/LayoutTests/ChangeLog	2015-08-25 01:48:18 UTC (rev 188901)
@@ -1,3 +1,16 @@
+2015-08-24  Nan Wang  <n_w...@apple.com>
+
+        AX: Fix accessibility/mac/search-with-frames.html test
+        https://bugs.webkit.org/show_bug.cgi?id=148313
+
+        Reviewed by Chris Fleizach.
+
+        Fixed the test by making sure that search is performed after all frames
+        have been loaded.
+
+        * accessibility/mac/search-with-frames.html:
+        * platform/mac/TestExpectations:
+
 2015-08-24  Alexey Proskuryakov  <a...@apple.com>
 
         Marking more scroll-snap tests as flaky.

Modified: trunk/LayoutTests/accessibility/mac/search-with-frames.html (188900 => 188901)


--- trunk/LayoutTests/accessibility/mac/search-with-frames.html	2015-08-25 01:22:31 UTC (rev 188900)
+++ trunk/LayoutTests/accessibility/mac/search-with-frames.html	2015-08-25 01:48:18 UTC (rev 188901)
@@ -25,30 +25,41 @@
 
 </script>
 <script>
+   var frame1aLoaded = false;
+   var frame2aLoaded = false;
+   var frame3aLoaded = false;
+   
    for (var k = 1; k <= 3; k++) {
 
       // This block adds sub frames to each of the frames, with some content in them. 
       // When the last frame loads, it runs the test.
 
       document.getElementById("frame" + k)._onload_ = function(e) { 
-          var ifrm = document.createElement("iframe"); 
-          ifrm.setAttribute("name", e.target.id + "a");
+          var iframe = document.createElement("iframe"); 
+          iframe.setAttribute("name", e.target.id + "a");
 
+          iframe._onload_ = function() {
+              if (iframe.name == "frame1a")
+                  frame1aLoaded = true;
+              else if (iframe.name == "frame2a")
+                  frame2aLoaded = true;
+              else if (iframe.name == "frame3a")
+                  frame3aLoaded = true;
+              
+              // Call runTest() when all frames have been loaded.
+              if (frame1aLoaded && frame2aLoaded && frame3aLoaded)
+                  runTest();
+          };
+
           if (e.target.id == "frame2") {
-              ifrm.setAttribute("src", "data:text/html,<body><button id=button2>button2</button></body>"); 
+              iframe.setAttribute("src", "data:text/html,<body><button id=button2>button2</button></body>"); 
           } else {
-              ifrm.setAttribute("src", "data:text/html,<body>text</body>"); 
+              iframe.setAttribute("src", "data:text/html,<body>text</body>"); 
           }
 
-          ifrm.style.width = "200"; 
-          ifrm.style.height = "200"; 
-          this.contentDocument.childNodes[0].childNodes[1].appendChild(ifrm); 
-          if (e.target.id == "frame3") {
-             ifrm._onload_ = function() {
-                 // runTest() might run on the same call stack and the frame is not actually finished loading.
-                 setTimeout("runTest()", 0);
-             };
-          }
+          iframe.style.width = "200"; 
+          iframe.style.height = "200"; 
+          this.contentDocument.childNodes[0].childNodes[1].appendChild(iframe); 
        };
     }
 

Modified: trunk/LayoutTests/platform/mac/TestExpectations (188900 => 188901)


--- trunk/LayoutTests/platform/mac/TestExpectations	2015-08-25 01:22:31 UTC (rev 188900)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2015-08-25 01:48:18 UTC (rev 188901)
@@ -485,8 +485,6 @@
 http/tests/misc/willCacheResponse-delegate-callback.html [ Failure ]
 http/tests/xmlhttprequest/basic-auth-nopassword.html [ Failure ]
 
-accessibility/mac/search-with-frames.html [ Pass Failure ] 
-
 # --- Plugins ---
 # WebKit1 OOP plug-ins: Can't evaluate _javascript_ from NPP_Destroy.
 plugins/document-open.html
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to