Title: [280932] trunk/LayoutTests
Revision
280932
Author
[email protected]
Date
2021-08-11 15:18:38 -0700 (Wed, 11 Aug 2021)

Log Message

http/tests/xmlhttprequest/interactive-state.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=229006
<rdar://80343834>

Reviewed by Alex Christensen.

* http/tests/xmlhttprequest/interactive-state-expected.txt:
Rebaseline test as the output is a bit different now.

* http/tests/xmlhttprequest/interactive-state.cgi:
Use sleep instead of writing a lot of data to make sure that
the data is processed in chunks.

* http/tests/xmlhttprequest/interactive-state.html:
Modernize test a bit.

* platform/mac-wk1/TestExpectations:
Unskip test as it should no longer be flaky.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (280931 => 280932)


--- trunk/LayoutTests/ChangeLog	2021-08-11 22:05:02 UTC (rev 280931)
+++ trunk/LayoutTests/ChangeLog	2021-08-11 22:18:38 UTC (rev 280932)
@@ -1,3 +1,24 @@
+2021-08-11  Chris Dumez  <[email protected]>
+
+        http/tests/xmlhttprequest/interactive-state.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=229006
+        <rdar://80343834>
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/xmlhttprequest/interactive-state-expected.txt:
+        Rebaseline test as the output is a bit different now.
+
+        * http/tests/xmlhttprequest/interactive-state.cgi:
+        Use sleep instead of writing a lot of data to make sure that
+        the data is processed in chunks.
+
+        * http/tests/xmlhttprequest/interactive-state.html:
+        Modernize test a bit.
+
+        * platform/mac-wk1/TestExpectations:
+        Unskip test as it should no longer be flaky.
+
 2021-08-11  Alex Christensen  <[email protected]>
 
         REGRESSION (r278392) performance.measure should never throw an InvalidAccessError for fetchStart

Modified: trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state-expected.txt (280931 => 280932)


--- trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state-expected.txt	2021-08-11 22:05:02 UTC (rev 280931)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state-expected.txt	2021-08-11 22:18:38 UTC (rev 280932)
@@ -1,3 +1,10 @@
-Test for bug 7392: GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data.
+Test XmlHttpRequest onreadystatechange being called for each chunk of data (bug 7392).
 
-SUCCESS
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS onreadystatechange was called for each chunk of data
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.cgi (280931 => 280932)


--- trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.cgi	2021-08-11 22:05:02 UTC (rev 280931)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.cgi	2021-08-11 22:18:38 UTC (rev 280932)
@@ -1,5 +1,7 @@
 #!/usr/bin/perl -w
 
+use Time::HiRes;
+
 # flush the buffers after each print
 select (STDOUT);
 $| = 1;
@@ -6,7 +8,7 @@
 
 print "Content-Type: text/html\n\n";
 
-for ($count=1; $count<3000; $count++) {
+for ($count=1; $count<5; $count++) {
     print "&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;  ";
     print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
     print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
@@ -15,4 +17,5 @@
     print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;";
     print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
     print "&#x0020;&#x0020;&#x0020; &#x20; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    Time::HiRes::sleep(0.5);
 }

Modified: trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.html (280931 => 280932)


--- trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.html	2021-08-11 22:05:02 UTC (rev 280931)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.html	2021-08-11 22:18:38 UTC (rev 280932)
@@ -1,64 +1,28 @@
+<!DOCTYPE html>
 <html>
 <head>
-<title>Test XmlHttpRequest onreadystatechange being called for each chunk of data</title>
+<script src=""
 <body>
-<p>Test for <a href="" 7392</a>:
-GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data.</p>
 <script>
+    description("Test XmlHttpRequest onreadystatechange being called for each chunk of data (bug 7392).");
+    jsTestIsAsync = true;
 
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-    var console_messages = document.createElement("ol");
-    document.body.appendChild(console_messages);
+    let count = 0;
     
-    var count = 0;
-    
-    function log(message)
-    {
-        var item = document.createElement("li");
-        item.appendChild(document.createTextNode(message));
-        console_messages.appendChild(item);
-    }
-    
-    function get(url, async)
-    {
-        if (window.XMLHttpRequest) {
-            req = new XMLHttpRequest();
-        } else {
-            try {
-                req = new ActiveXObject("Msxml2.XMLHTTP");
-            } catch (ex) {
-                req = new ActiveXObject("Microsoft.XMLHTTP");
-            }
-        }
-        
-        req._onreadystatechange_ = processStateChange;
-        
-        req.open('GET', url, async);
-        req.send(null);
-
-        if (!async && req.status != 200)
-            throw ("HTTP request failed, status: " + req.status);
-        
-        return req;
-    }
-    
-    function processStateChange(){
-        if (req.readyState == 3)
+    let req = new XMLHttpRequest();
+    req._onreadystatechange_ = () => {
+        if (req.readyState == XMLHttpRequest.LOADING)
             ++count;
-        else if (req.readyState == 4) {
-            log((count > 1) ? "SUCCESS" : "FAILURE (count = " + count + ")");
-            if (window.testRunner)
-                testRunner.notifyDone();
+        else if (req.readyState == XMLHttpRequest.DONE) { 
+            if (count > 1)
+                testPassed("onreadystatechange was called for each chunk of data");
+            else
+                testFailed("onreadystatechange should have been called more than once but was called " + count + " times");
+            finishJSTest();
         }
-    }
-    
-    // start async steps
-    get('interactive-state.cgi', true);
-    
+    };
+    req.open('GET', 'interactive-state.cgi', true);
+    req.send(null);
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (280931 => 280932)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2021-08-11 22:05:02 UTC (rev 280931)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2021-08-11 22:18:38 UTC (rev 280932)
@@ -1268,9 +1268,6 @@
 # rdar://80332615 ([Monterey Wk1 Debug] compositing/clipping/border-radius-on-webgl.html is a constant failure)
 [ Monterey Debug ] compositing/clipping/border-radius-on-webgl.html [ Pass ImageOnlyFailure ]
 
-# rdar://80343834 ([ Monterey wk1 Debug ] http/tests/xmlhttprequest/interactive-state.html is a flaky failure)
-[ Monterey Debug ] http/tests/xmlhttprequest/interactive-state.html [ Pass Failure ]
-
 # rdar://80346720 ([Monterey Wk1] media/media-source/media-webm-opus-partial.html is a consistent failure)
 [ Monterey ] media/media-source/media-webm-opus-partial.html [ Failure ]
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to