Skip to content

Commit

Permalink
Layout Test http/wpt/fetch/response-opaque-clone.html is sometimes ti…
Browse files Browse the repository at this point in the history
…ming out on iOS simulator

https://bugs.webkit.org/show_bug.cgi?id=194525
<rdar://problem/48012229>

Reviewed by Alex Christensen.

Test is no longer flaky on MacOS.
As per flakiness dashboard, it sometimes times out on iOS simulator.
It sometimes passes after running for 20 seconds.
Mark it as Slow and improve the test to output more sub-tests.
Removed unnecessary removal of cache since test runner will clear them at the end of the test.

* http/wpt/fetch/response-opaque-clone-expected.txt:
* http/wpt/fetch/response-opaque-clone.html:
* platform/ios-simulator-wk2/TestExpectations:


Canonical link: https://commits.webkit.org/211068@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf committed Apr 10, 2019
1 parent d0e2ca5 commit ff43547
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
18 changes: 18 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2019-04-10 Youenn Fablet <youenn@apple.com>

Layout Test http/wpt/fetch/response-opaque-clone.html is sometimes timing out on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=194525
<rdar://problem/48012229>

Reviewed by Alex Christensen.

Test is no longer flaky on MacOS.
As per flakiness dashboard, it sometimes times out on iOS simulator.
It sometimes passes after running for 20 seconds.
Mark it as Slow and improve the test to output more sub-tests.
Removed unnecessary removal of cache since test runner will clear them at the end of the test.

* http/wpt/fetch/response-opaque-clone-expected.txt:
* http/wpt/fetch/response-opaque-clone.html:
* platform/ios-simulator-wk2/TestExpectations:

2019-04-10 Justin Fan <justin_fan@apple.com>

[Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
Expand Down
3 changes: 3 additions & 0 deletions LayoutTests/http/wpt/fetch/response-opaque-clone-expected.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

PASS Check opaque response can be cloned and cached correctly
PASS fetched response
PASS cloned response
PASS cached response

33 changes: 19 additions & 14 deletions LayoutTests/http/wpt/fetch/response-opaque-clone.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,46 @@
<script src="/common/get-host-info.sub.js"></script>
<script>

function testResponseOpacity(response, test, testName)
function testResponseOpacity(response, testName)
{
assert_equals(response.type, "opaque", testName + " type");
assert_equals(response.status, 0, testName + " status");
assert_equals(response.statusText, "", testName + " statusText");
assert_equals(response.url, "", testName + " url");
assert_false(response.redirected, testName + " redirected");
assert_true(response.headers.values().next().done, testName + " headers");
assert_equals(response.body, null, testName + " opaque response body should be null");
test(() => {
assert_equals(response.type, "opaque", testName + " type");
assert_equals(response.status, 0, testName + " status");
assert_equals(response.statusText, "", testName + " statusText");
assert_equals(response.url, "", testName + " url");
assert_false(response.redirected, testName + " redirected");
assert_true(response.headers.values().next().done, testName + " headers");
assert_equals(response.body, null, testName + " opaque response body should be null");
}, testName);
}
promise_test(async function(test) {

promise_test(async function() {
var request = new Request(get_host_info().HTTP_REMOTE_ORIGIN, { mode: "no-cors" });
var response = await fetch(request);

testResponseOpacity(response, test, "fetched response");
testResponseOpacity(response, "fetched response");

var clone = response.clone();

testResponseOpacity(clone, test, "cloned response");
testResponseOpacity(clone, "cloned response");
var buffer = await clone.arrayBuffer();
assert_equals(buffer.byteLength, 0, "cloned opaque response buffer should be null");

// WK1 does not support Cache API yet.
if (!self.caches)
if (!self.caches) {
test(() => {
}, "cached response");
return;
}

var cache = await self.caches.open("test");
await cache.put(request, response);
var cached = await cache.match(request.url);

testResponseOpacity(cached, test, "cached response")
testResponseOpacity(cached, "cached response")
buffer = await cached.arrayBuffer();
assert_equals(buffer.byteLength, 0, "cached opaque response buffer should be null");

await self.caches.delete("test");
}, "Check opaque response can be cloned and cached correctly");
</script>
</body>
Expand Down
1 change: 1 addition & 0 deletions LayoutTests/platform/ios-simulator-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ webkit.org/b/196112 imported/w3c/web-platform-tests/mathml/relations/css-styling
webkit.org/b/196357 storage/indexeddb/modern/idbtransaction-objectstore-failures-private.html [ Pass Failure ]

webkit.org/b/196358 http/wpt/cache-storage/quota-third-party.https.html [ Pass Failure ]
http/wpt/fetch/response-opaque-clone.html [ Slow ]

webkit.org/b/196376 [ Debug ] storage/domstorage/localstorage/private-browsing-affects-storage.html [ Pass Failure ]

Expand Down

0 comments on commit ff43547

Please sign in to comment.