Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-event.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-event.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-event.html |
index a27c2b9490fdff21e50bdaec2743070d49166626..8b9cb40ceaca384bbeb2211249544c4dfd018703 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-event.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-event.html |
@@ -67,47 +67,6 @@ |
}) |
.catch(unreached_rejection(t)); |
}, 'Service Worker responds to fetch event with the referrer URL'); |
- |
-async_test(function(t) { |
- var scope = 'resources/simple.html?clientId'; |
- var frame; |
- var client_id1, client_id2; |
- service_worker_unregister_and_register(t, worker, scope) |
- .then(function(reg) { |
- return wait_for_state(t, reg.installing, 'activated'); |
- }) |
- .then(function() { return with_iframe(scope); }) |
- .then(function(f) { |
- frame = f; |
- assert_equals( |
- frame.contentDocument.body.textContent.substr(0, 19), |
- 'Client ID Not Found', |
- 'Service Worker should respond to navigation fetch with no ' + |
- 'client id'); |
- return frame.contentWindow.fetch('resources/other.html?clientId'); |
- }) |
- .then(function(response) { return response.text(); }) |
- .then(function(response_text) { |
- client_id1 = response_text.substr(17, 36); |
- assert_equals( |
- response_text.substr(0, 15), |
- 'Client ID Found', |
- 'Service Worker should respond to fetch with a client id'); |
- return frame.contentWindow.fetch('resources/other.html?clientId'); |
- }) |
- .then(function(response) { return response.text(); }) |
- .then(function(response_text) { |
- client_id2 = response_text.substr(17, 36); |
- assert_equals( |
- client_id1, |
- client_id2, |
- 'Service Worker should respond to another fetch from the same ' + |
- 'client with the same client id'); |
- frame.remove(); |
- return service_worker_unregister_and_done(t, scope); |
- }) |
- .catch(unreached_rejection(t)); |
- }, 'Service Worker responds to fetch event with a client id'); |
async_test(function(t) { |
var scope = 'resources/simple.html?ignore'; |
@@ -196,9 +155,8 @@ |
}) |
.then(function(frame) { |
assert_equals(frame.contentDocument.body.textContent, |
- 'POST:application/x-www-form-urlencoded:' + |
- 'testName1=testValue1&testName2=testValue2'); |
- frame.remove(); |
+ 'POST:testName1=testValue1&testName2=testValue2'); |
+ document.body.removeChild(frame); |
return service_worker_unregister_and_done(t, scope); |
}) |
.catch(unreached_rejection(t)); |
@@ -214,7 +172,15 @@ |
.then(function(frame) { |
assert_equals( |
frame.contentDocument.body.textContent, |
- '(0)(1)[InvalidStateError](2)[InvalidStateError]', |
+ '(0)', |
+ 'Response should be the argument of the first respondWith() call.'); |
+ frame.remove(); |
+ return with_iframe(scope); |
+ }) |
+ .then(function(frame) { |
+ assert_equals( |
+ frame.contentDocument.body.textContent, |
+ '(0)(1)[InvalidStateError](2)[InvalidStateError](0)', |
'Multiple calls of respondWith must throw InvalidStateErrors.'); |
frame.remove(); |
return service_worker_unregister_and_done(t, scope); |
@@ -224,7 +190,6 @@ |
async_test(function(t) { |
var scope = 'resources/simple.html?used-check'; |
- var first_frame; |
service_worker_unregister_and_register(t, worker, scope) |
.then(function(reg) { |
return wait_for_state(t, reg.installing, 'activated'); |
@@ -234,7 +199,7 @@ |
assert_equals(frame.contentDocument.body.textContent, |
'Here\'s an other html file.\n', |
'Response should come from fetched other file'); |
- first_frame = frame; |
+ frame.remove(); |
return with_iframe(scope); |
}) |
.then(function(frame) { |
@@ -246,7 +211,6 @@ |
frame.contentDocument.body.textContent, |
'bodyUsed: true', |
'event.respondWith must set the used flag.'); |
- first_frame.remove(); |
frame.remove(); |
return service_worker_unregister_and_done(t, scope); |
}) |