Skip to content

Commit

Permalink
Update WebKit tests for the unified HTTP stack
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=273806

Reviewed by Alex Christensen and Alexey Proskuryakov.

Fixing 2 tests that fails on the unified HTTP stack.

* LayoutTests/imported/w3c/web-platform-tests/websockets/handlers/sleep_10_v13_wsh.py:
(web_socket_do_extra_handshake): Fixing imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/close/close-connecting.html?wss, import upstream WPT changes.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(TestWebKitAPI::ResumeWithExtraInitialDataOnDisk)): Fixing TestWebKitAPI.WKDownload.ResumeWithExtraInitialDataOnDisk, the new stack uses the actual file size on disk to determine where to resume the download.

Canonical link: https://commits.webkit.org/278771@main
  • Loading branch information
guoye-zhang authored and achristensen07 committed May 14, 2024
1 parent 9142a5f commit 2cb0dc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@
from mod_pywebsocket import msgutil

def web_socket_do_extra_handshake(request):
request.connection.write(b'x')
time.sleep(2)
request.connection.write(b'x')
time.sleep(2)
request.connection.write(b'x')
time.sleep(2)
request.connection.write(b'x')
time.sleep(2)
request.connection.write(b'x')
time.sleep(2)
time.sleep(10)
return

def web_socket_transfer_data(request):
Expand Down
4 changes: 2 additions & 2 deletions Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1939,10 +1939,10 @@ HTTPServer server([connectionCount = 0](TestWebKitAPI::Connection connection) mu
NSError *error = nil;
[[NSFileManager defaultManager] removeItemAtURL:expectedDownloadFile error:&error];
EXPECT_NULL(error);
EXPECT_TRUE([[(NSString *)makeString(longString<3000>('b'), longString<3000>('c')) dataUsingEncoding:NSUTF8StringEncoding] writeToURL:expectedDownloadFile atomically:YES]);
EXPECT_TRUE([[(NSString *)makeString(longString<3000>('b'), longString<2000>('c')) dataUsingEncoding:NSUTF8StringEncoding] writeToURL:expectedDownloadFile atomically:YES]);
});

checkFileContents(expectedDownloadFile, makeString(longString<3000>('b'), longString<3000>('c'), longString<5000>('d')));
checkFileContents(expectedDownloadFile, makeString(longString<3000>('b'), longString<2000>('c'), longString<5000>('d')));
}

TEST(WKDownload, ResumeWithInvalidResumeData)
Expand Down

0 comments on commit 2cb0dc3

Please sign in to comment.