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

Unified Diff: third_party/WebKit/LayoutTests/battery-status/detached-no-crash.html

Issue 2880763002: [Battery] Allow usage from SecureContext or top-level browsing context only. (Closed)
Patch Set: Remove battery-iframe.https-expected.txt and battery-insecure-context-expected.txt Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/battery-status/detached-no-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/battery-status/detached-no-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698