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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html

Issue 726543008: [ServiceWorker] Fix ASSERT failure in DocumentThreadableLoader::handleResponse(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html
diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html b/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html
index 8dd5bcfb7eea5c996050f708e2a687a4e3bbc848..06de143fcb312017ba82bb4ddda878bb4de2e1a2 100644
--- a/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html
@@ -143,6 +143,48 @@ function mode_credentials_test() {
});
}
+function data_url_test() {
+ return new Promise(function(resolve, reject) {
+ var xhr = new XMLHttpRequest();
+ xhr.onload = function() {
+ resolve(xhr.response);
+ };
+ xhr.onerror = function() {
+ reject('XHR should succeed.');
+ };
+ xhr.responseType = 'text';
+ xhr.open('GET', 'data:text/html,Foobar', true);
+ xhr.send();
+ })
+ .then(function(data) {
+ assert_equals(data, 'Foobar');
+ });
+}
+
+function xhr_options_test() {
+ return new Promise(function(resolve, reject) {
+ var xhr = new XMLHttpRequest();
+ xhr.onload = function() {
+ resolve(xhr.response);
+ };
+ xhr.onerror = function() {
+ reject('XHR should succeed.');
+ };
+ xhr.responseType = 'text';
+ xhr.open('OpTiOnS', 'fetch-access-control.php', true);
+ xhr.send();
+ })
+ .then(function(data) {
+ var result;
+ var report = function(arg) {
+ result = arg;
+ };
+ eval(data);
+ assert_equals(result['jsonpResult'], 'success');
+ assert_equals(result['method'], 'OPTIONS');
+ })
+}
+
window.addEventListener('message', function(evt) {
var port = evt.ports[0];
string_test()
@@ -150,6 +192,8 @@ window.addEventListener('message', function(evt) {
.then(custom_method_test)
.then(form_data_test)
.then(mode_credentials_test)
+ .then(data_url_test)
+ .then(xhr_options_test)
.then(function() { port.postMessage({results: 'finish'}); })
.catch(function(e) { port.postMessage({results: 'failure:' + e}); });
});
« no previous file with comments | « no previous file | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698