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

Unified Diff: LayoutTests/http/tests/notifications/notification-properties.html

Issue 1234553003: Supports the sound attribute to the Notification object Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: [WIP] Created 5 years, 5 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 | LayoutTests/http/tests/notifications/serviceworkerregistration-document-sound-throw.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/notifications/notification-properties.html
diff --git a/LayoutTests/http/tests/notifications/notification-properties.html b/LayoutTests/http/tests/notifications/notification-properties.html
index f54a903dc501b4142c5e42c88db5ef32ee43ea90..7c7702295a14dcf96e9855b0c31315b4206b5a3e 100644
--- a/LayoutTests/http/tests/notifications/notification-properties.html
+++ b/LayoutTests/http/tests/notifications/notification-properties.html
@@ -40,6 +40,7 @@
assert_equals(emptyNotification.body, "");
assert_equals(emptyNotification.tag, "");
assert_equals(emptyNotification.icon, "");
+ assert_equals(notification.sound, "");
assert_equals(notification.vibrate, null);
assert_false(emptyNotification.silent);
assert_equals(emptyNotification.data, null);
@@ -64,6 +65,28 @@
// Setting an empty string as the tag should be equal to not setting the tag at all.
assert_equals(noTagNotification.tag, emptyTagNotification.tag);
+ var invalidSoundNotification = new Notification("My Notification", {
+ sound: "http://test:test/test.mp3"
+ });
+
+ // Invalid sound URLs should be reset to an empty string.
+ assert_equals(invalidSoundNotification.sound, "");
+
+ var serializedSoundUrlNotification = new Notification("My Notification", {
+ sound: "http://example.com/example.mp3"
+ });
+
+ // Sound URLs should be returned in serialized form.
+ assert_equals(serializedSoundUrlNotification.sound, "http://example.com/example.mp3");
+
+ // Verifying the exception throwing behavior, when silent set true and sound is presented.
+ assert_throws(new TypeError(), function() {
+ var notification = new Notification("My Notification", {
+ silent: true,
+ sound: "http://example.com/example.mp3"
+ });
+ }, 'Set sound, when silent is true.');
+
var vibrateNotification = new Notification("My Notification", {
vibrate: 1000
});
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/serviceworkerregistration-document-sound-throw.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698