Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html |
| diff --git a/third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html b/third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html |
| index 3caf6e0543c46182c722c6e673fdf3b1c34aa7ae..286b56892ea7f4f2d6114caca92cdd419c126c39 100644 |
| --- a/third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html |
| +++ b/third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html |
| @@ -10,6 +10,7 @@ window.jsTestIsAsync = true; |
| var w; |
| var nav; |
| +var promise; |
| function processMessage(event) { |
| if (event.data == "opened") { |
| @@ -18,8 +19,14 @@ function processMessage(event) { |
| w.close(); |
| w = null; |
| } else if (event.data == "closed") { |
| - shouldBeUndefined("nav.getBattery()"); |
| - finishJSTest(); |
| + promise = nav.getBattery(); |
|
timvolodine
2017/05/25 16:01:13
nit: you can probably get rid of var promise and d
riju_
2017/05/30 06:36:00
Done.
|
| + promise.then(battery => { |
| + assert_unreachable('getBattery should reject on a closed window'); |
| + }) |
| + .catch(error => { |
| + assert_equals(error.code, DOMException.SECURITY_ERR); |
|
timvolodine
2017/05/25 16:01:14
nit: maybe add a shouldBeTrue / shouldBeEqualToNum
riju_
2017/05/30 06:36:00
Done.
|
| + }); |
| + finishJSTest(); |
| } |
| } |