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

Unified Diff: LayoutTests/push_messaging/push-messaging.html

Issue 676003002: Add layout tests for hasPermission (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@push_has_permission
Patch Set: Created 6 years, 2 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
Index: LayoutTests/push_messaging/push-messaging.html
diff --git a/LayoutTests/push_messaging/push-messaging.html b/LayoutTests/push_messaging/push-messaging.html
index 16e1e439315b04655ab5eda81f2a03e4cb51f258..9ea4dc4a4515a4864ef921df9bde91c0dbc3f78d 100644
--- a/LayoutTests/push_messaging/push-messaging.html
+++ b/LayoutTests/push_messaging/push-messaging.html
@@ -31,12 +31,24 @@ function testPushRegistrationSuccess() {
registration = reg;
shouldBeEqualToString('registration.pushEndpoint', 'endpoint');
shouldBeEqualToString('registration.pushRegistrationId', 'registrationId');
- finishJSTest();
+ testPushHasPermission('granted');
Michael van Ouwerkerk 2014/10/24 12:53:01 Is this a tab for whitespace? Oh dear.
Miguel Garcia 2014/10/31 17:04:47 Done. Sorry about that, I configured eclipse prope
Miguel Garcia 2014/10/31 17:04:47 Done.
}, function(e) {
testFailed('Error callback invoked unexpectedly.');
finishJSTest();
});
}
+
+function testPushHasPermission(expectedStatus) {
Michael van Ouwerkerk 2014/10/24 12:53:01 Please separate the tests more cleanly by making t
Miguel Garcia 2014/10/31 17:04:47 Done.
+ navigator.push.hasPermission().then(function(permissionStatus) {
+ status = permissionStatus;
+ shouldBeEqualToString("status", expectedStatus);
Michael van Ouwerkerk 2014/10/24 12:53:01 nit: single quotes for js strings
Peter Beverloo 2014/10/24 13:03:24 shouldBeEqualToString takes two literal strings wh
Miguel Garcia 2014/10/31 17:04:47 Not that it matters now but expectedStatus is alre
+ finishJSTest();
+ }, function() {
+ testFailed('Error callback invoked unexpectedly.');
+ finishJSTest();
+ });
+}
+
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698