Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: LayoutTests/http/tests/serviceworker/fetch-request-redirect.html

Issue 1293023003: Re-enable iframe load failure tests in fetch-request-redirect.html. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/fetch-request-redirect.html
diff --git a/LayoutTests/http/tests/serviceworker/fetch-request-redirect.html b/LayoutTests/http/tests/serviceworker/fetch-request-redirect.html
index 9af3a6e243247ab0ba8ea91696c751a876b55743..f7c42481f534a8b0bcb23752aedc9f5c41947dd4 100644
--- a/LayoutTests/http/tests/serviceworker/fetch-request-redirect.html
+++ b/LayoutTests/http/tests/serviceworker/fetch-request-redirect.html
@@ -18,11 +18,21 @@ function assert_rejects(promise, description) {
function() {});
}
-function iframe_test(url) {
+function iframe_test(url, timeout_enabled) {
return new Promise(function(resolve, reject) {
var frame = document.createElement('iframe');
frame.src = url;
+ if (timeout_enabled) {
+ // We can't catch the network error on iframe. So we use the timer for
+ // failure detection.
+ var timer = setTimeout(function() {
+ reject(new Error('iframe load timeout'));
+ frame.remove();
+ }, 1000);
+ }
frame.onload = function() {
+ if (timeout_enabled)
+ clearTimeout(timer);
if (frame.contentDocument.body.textContent == 'Hello world\n')
resolve();
else
@@ -146,23 +156,20 @@ promise_test(function(t) {
'&redirect-mode=follow'),
'Redirected iframe loading with Request.redirect=follow should'+
' succeed.'),
-
- /*
- TODO(horo): iframe load failure detection is unreliable.
- Rework these. crbug.com/522587
assert_rejects(
iframe_test(SCOPE + '?url=' +
encodeURIComponent(REDIRECT_TO_HTML_URL) +
- '&redirect-mode=error'),
+ '&redirect-mode=error',
+ true /* timeout_enabled */),
'Redirected iframe loading with Request.redirect=error should '+
'fail.'),
assert_resolves(
iframe_test(SCOPE + '?url=' +
encodeURIComponent(REDIRECT_TO_HTML_URL) +
- '&redirect-mode=manual'),
+ '&redirect-mode=manual',
+ true /* timeout_enabled */),
'Redirected iframe loading with Request.redirect=manual should'+
' succeed.'),
- */
]);
})
.then(function() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698