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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/test-helpers.js

Issue 625943002: Catch uncaught promise rejections from V8 and log to console. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added promise.catch in test-helpers.js Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Adapter for testharness.js-style tests with Service Workers 1 // Adapter for testharness.js-style tests with Service Workers
2 2
3 function service_worker_unregister_and_register(test, url, scope) { 3 function service_worker_unregister_and_register(test, url, scope) {
4 if (!scope || scope.length == 0) 4 if (!scope || scope.length == 0)
5 return Promise.reject(new Error('tests must define a scope')); 5 return Promise.reject(new Error('tests must define a scope'));
6 6
7 var options = { scope: scope }; 7 var options = { scope: scope };
8 return service_worker_unregister(test, scope) 8 return service_worker_unregister(test, scope)
9 .then(function() { 9 .then(function() {
10 return navigator.serviceWorker.register(url, options); 10 return navigator.serviceWorker.register(url, options);
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 248 }
249 249
250 function test_login(test, origin, username, password) { 250 function test_login(test, origin, username, password) {
251 return new Promise(function(resolve, reject) { 251 return new Promise(function(resolve, reject) {
252 with_iframe( 252 with_iframe(
253 origin + base_path() + 253 origin + base_path() +
254 'resources/fetch-access-control-login.html') 254 'resources/fetch-access-control-login.html')
255 .then(test.step_func(function(frame) { 255 .then(test.step_func(function(frame) {
256 var channel = new MessageChannel(); 256 var channel = new MessageChannel();
257 channel.port1.onmessage = test.step_func(function() { 257 channel.port1.onmessage = test.step_func(function() {
258 unload_iframe(frame); 258 unload_iframe(frame).catch(function() {});
259 resolve(); 259 resolve();
260 }); 260 });
261 frame.contentWindow.postMessage( 261 frame.contentWindow.postMessage(
262 {username: username, password: password}, 262 {username: username, password: password},
263 [channel.port2], origin); 263 [channel.port2], origin);
264 })); 264 }));
265 }); 265 });
266 } 266 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/console-test.js ('k') | LayoutTests/inspector/console/console-format-es6.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698