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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html

Issue 2600733002: Convert budget LayoutTests to use promise_test. (Closed)
Patch Set: Created 4 years 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
Index: third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
index 8ebb91b00e46067d19ed8101f9abd0601678bcc8..31c8d19f41f5f6274a5850e8416be1345d11d8c2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
+++ b/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
@@ -11,16 +11,15 @@
</head>
<body>
<script>
- async_test(function(test) {
- var script = 'resources/instrumentation-service-worker.js';
- var scope = 'resources/scope/' + location.pathname;
- var port;
+ promise_test(function(test) {
+ const script = 'resources/instrumentation-service-worker.js';
+ const scope = 'resources/scope/' + location.pathname;
+ let port;
- budgetServiceMock.then(mock => {
- getActiveServiceWorkerWithMessagePort(test, script, scope)
+ return budgetServiceMock.then(mock => {
+ return getActiveServiceWorkerWithMessagePort(test, script, scope)
.then(function(workerInfo) {
port = workerInfo.port;
- port.postMessage({ command: 'getCostInvalidType' });
port.addEventListener('message', function(event) {
if (typeof event.data != 'object' || !event.data.command)
@@ -30,8 +29,9 @@
assert_false(event.data.success,
'getCost should fail with invalid arguments.');
assert_equals(event.data.errorMessage, "Failed to execute 'getCost' on 'BudgetService': The provided value 'frobinator' is not a valid enum value of type OperationType.");
- test.done();
});
+
+ return sendCommand(port, { command: 'getCostInvalidType' });
})
.catch(unreached_rejection(test));
});

Powered by Google App Engine
This is Rietveld 408576698