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..58cbb5de86dd2917d9bac478527b387725c9605f 100644 |
--- a/third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html |
+++ b/third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html |
@@ -18,8 +18,15 @@ function processMessage(event) { |
w.close(); |
w = null; |
} else if (event.data == "closed") { |
- shouldBeUndefined("nav.getBattery()"); |
- finishJSTest(); |
+ nav.getBattery().then(battery => { |
+ assert_unreachable('getBattery should reject on a closed window'); |
+ }) |
+ .catch(error => { |
+ // DOMException.SECURITY_ERR = 18. |
+ debug('Error Code is ' + error.code); |
+ assert_equals(error.code, DOMException.SECURITY_ERR); |
+ }); |
+ setTimeout(finishJSTest, 0); |
} |
} |