⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280932 in webkit


Ignore:
Timestamp:
Aug 11, 2021, 3:18:38 PM (5 years ago)
Author:
Chris Dumez
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.

Location:
trunk/LayoutTests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r280931 r280932  
     12021-08-11  Chris Dumez  <cdumez@apple.com>
     2
     3        http/tests/xmlhttprequest/interactive-state.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=229006
     5        <rdar://80343834>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * http/tests/xmlhttprequest/interactive-state-expected.txt:
     10        Rebaseline test as the output is a bit different now.
     11
     12        * http/tests/xmlhttprequest/interactive-state.cgi:
     13        Use sleep instead of writing a lot of data to make sure that
     14        the data is processed in chunks.
     15
     16        * http/tests/xmlhttprequest/interactive-state.html:
     17        Modernize test a bit.
     18
     19        * platform/mac-wk1/TestExpectations:
     20        Unskip test as it should no longer be flaky.
     21
    1222021-08-11  Alex Christensen  <achristensen@webkit.org>
    223
  • trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state-expected.txt

    r21687 r280932  
    1 Test for bug 7392: GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data.
     1Test XmlHttpRequest onreadystatechange being called for each chunk of data (bug 7392).
    22
    3 SUCCESS
     3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     4
     5
     6PASS onreadystatechange was called for each chunk of data
     7PASS successfullyParsed is true
     8
     9TEST COMPLETE
     10
  • trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.cgi

    r12931 r280932  
    11#!/usr/bin/perl -w
     2
     3use Time::HiRes;
    24
    35# flush the buffers after each print
     
    79print "Content-Type: text/html\n\n";
    810
    9 for ($count=1; $count<3000; $count++) {
     11for ($count=1; $count<5; $count++) {
    1012    print "&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;  ";
    1113    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
     
    1618    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
    1719    print "&#x0020;&#x0020;&#x0020; &#x20; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
     20    Time::HiRes::sleep(0.5);
    1821}
  • trunk/LayoutTests/http/tests/xmlhttprequest/interactive-state.html

    r120167 r280932  
     1<!DOCTYPE html>
    12<html>
    23<head>
    3 <title>Test XmlHttpRequest onreadystatechange being called for each chunk of data</title>
     4<script src="/js-test-resources/js-test.js"></script>
    45<body>
    5 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=7392">bug 7392</a>:
    6 GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data.</p>
    76<script>
     7    description("Test XmlHttpRequest onreadystatechange being called for each chunk of data (bug 7392).");
     8    jsTestIsAsync = true;
    89
    9     if (window.testRunner) {
    10         testRunner.dumpAsText();
    11         testRunner.waitUntilDone();
    12     }
    13 
    14     var console_messages = document.createElement("ol");
    15     document.body.appendChild(console_messages);
     10    let count = 0;
    1611   
    17     var count = 0;
    18    
    19     function log(message)
    20     {
    21         var item = document.createElement("li");
    22         item.appendChild(document.createTextNode(message));
    23         console_messages.appendChild(item);
    24     }
    25    
    26     function get(url, async)
    27     {
    28         if (window.XMLHttpRequest) {
    29             req = new XMLHttpRequest();
    30         } else {
    31             try {
    32                 req = new ActiveXObject("Msxml2.XMLHTTP");
    33             } catch (ex) {
    34                 req = new ActiveXObject("Microsoft.XMLHTTP");
    35             }
     12    let req = new XMLHttpRequest();
     13    req.onreadystatechange = () => {
     14        if (req.readyState == XMLHttpRequest.LOADING)
     15            ++count;
     16        else if (req.readyState == XMLHttpRequest.DONE) {
     17            if (count > 1)
     18                testPassed("onreadystatechange was called for each chunk of data");
     19            else
     20                testFailed("onreadystatechange should have been called more than once but was called " + count + " times");
     21            finishJSTest();
    3622        }
    37        
    38         req.onreadystatechange = processStateChange;
    39        
    40         req.open('GET', url, async);
    41         req.send(null);
    42 
    43         if (!async && req.status != 200)
    44             throw ("HTTP request failed, status: " + req.status);
    45        
    46         return req;
    47     }
    48    
    49     function processStateChange(){
    50         if (req.readyState == 3)
    51             ++count;
    52         else if (req.readyState == 4) {
    53             log((count > 1) ? "SUCCESS" : "FAILURE (count = " + count + ")");
    54             if (window.testRunner)
    55                 testRunner.notifyDone();
    56         }
    57     }
    58    
    59     // start async steps
    60     get('interactive-state.cgi', true);
    61    
     23    };
     24    req.open('GET', 'interactive-state.cgi', true);
     25    req.send(null);
    6226</script>
    6327</body>
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r280927 r280932  
    12691269[ Monterey Debug ] compositing/clipping/border-radius-on-webgl.html [ Pass ImageOnlyFailure ]
    12701270
    1271 # rdar://80343834 ([ Monterey wk1 Debug ] http/tests/xmlhttprequest/interactive-state.html is a flaky failure)
    1272 [ Monterey Debug ] http/tests/xmlhttprequest/interactive-state.html [ Pass Failure ]
    1273 
    12741271# rdar://80346720 ([Monterey Wk1] media/media-source/media-webm-opus-partial.html is a consistent failure)
    12751272[ Monterey ] media/media-source/media-webm-opus-partial.html [ Failure ]
Note: See TracChangeset for help on using the changeset viewer.