Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js b/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js |
| index faafdc685c4428e47e44dfb41d3b86e2a2fb6836..c68890f792a8404dd35953e56bcad710f3831432 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js |
| +++ b/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js |
| @@ -46,6 +46,26 @@ self.addEventListener('message', function(workerEvent) { |
| }).catch(makeErrorHandler(event.data.command)); |
| break; |
| + case 'checkInterfaces': |
| + var success = false; |
| + var message = ""; |
| + try { |
| + if ('BudgetService' in self && |
| + WorkerNavigator.prototype.hasOwnProperty('budget') && |
| + BudgetService.prototype.hasOwnProperty('getCost') && |
| + BudgetService.prototype.hasOwnProperty('getBudget') && |
| + BudgetService.prototype.hasOwnProperty('reserve') |
| + ) |
| + success = true; |
| + } catch(err) { |
| + message = err.message; |
| + } |
|
Peter Beverloo
2016/12/12 14:28:43
What exception do you expect to be thrown here? I
harkness
2016/12/12 16:00:34
Updated the code to remove the if statement, but l
|
| + port.postMessage({ |
| + command: event.data.command, |
| + success: success, |
| + message: message}); |
| + break; |
| + |
| default: |
| port.postMessage({ |
| command: 'error', |