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

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

Issue 1288553009: Fetch/Request/Redirect: Disable flaky cases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 341f1ccee1745030849b20d199d302e257ce9208..9af3a6e243247ab0ba8ea91696c751a876b55743 100644
--- a/LayoutTests/http/tests/serviceworker/fetch-request-redirect.html
+++ b/LayoutTests/http/tests/serviceworker/fetch-request-redirect.html
@@ -7,37 +7,33 @@
<script>
function assert_resolves(promise, description) {
- return promise.catch(function() { throw description; });
+ return promise.catch(function(reason) {
+ throw new Error(description + ' - ' + reason.message);
+ });
}
function assert_rejects(promise, description) {
return promise.then(
- function() { throw description; },
+ function() { throw new Error(description); },
function() {});
}
function iframe_test(url) {
return new Promise(function(resolve, reject) {
var frame = document.createElement('iframe');
- // We can't catch the network error on iframe. So we use the timer.
- var timer = setTimeout(function() {
- reject();
- frame.remove();
- }, 500);
frame.src = url;
frame.onload = function() {
- clearTimeout(timer);
if (frame.contentDocument.body.textContent == 'Hello world\n')
resolve();
else
- reject();
+ reject(new Error('content mismatch'));
frame.remove();
};
document.body.appendChild(frame);
});
}
-async_test(function(t) {
+promise_test(function(t) {
var SCOPE = 'resources/fetch-request-redirect-iframe.html';
var SCRIPT = 'resources/fetch-rewrite-worker.js';
var host_info = get_host_info();
@@ -58,7 +54,7 @@ async_test(function(t) {
var worker;
var frame;
- service_worker_unregister_and_register(t, SCRIPT, SCOPE)
+ return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
.then(function(registration) {
worker = registration.installing;
return wait_for_state(t, worker, 'activated');
@@ -150,6 +146,10 @@ async_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) +
@@ -162,12 +162,12 @@ async_test(function(t) {
'&redirect-mode=manual'),
'Redirected iframe loading with Request.redirect=manual should'+
' succeed.'),
+ */
]);
})
.then(function() {
frame.remove();
service_worker_unregister_and_done(t, SCOPE);
- })
- .catch(unreached_rejection(t));
+ });
}, 'Verify redirect mode of Fetch API and ServiceWorker FetchEvent.');
</script>
« 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