AX: Fix accessibility/mac/search-with-frames.html test
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 01:48:18 +0000 (01:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 01:48:18 +0000 (01:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148313

Patch by Nan Wang <n_wang@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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188901 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/mac/search-with-frames.html
LayoutTests/platform/mac/TestExpectations

index ae5ad8c..a108e74 100644 (file)
@@ -1,3 +1,16 @@
+2015-08-24  Nan Wang  <n_wang@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  <ap@apple.com>
 
         Marking more scroll-snap tests as flaky.
index a33bfd9..56c426b 100644 (file)
@@ -25,30 +25,41 @@ var successfullyParsed = false;
 
 </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); 
        };
     }
 
index 11eec3b..9269e0f 100644 (file)
@@ -485,8 +485,6 @@ webkit.org/b/96828 webgl/1.0.2/conformance/extensions/oes-vertex-array-object.ht
 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