Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / notifications / notification-data-property.html
blob92a8d89491f877504df30ac3d1a0211ab25be8e2
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Notifications: The Notification object exposes the expected data property.</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10 // Tests that the Notification object exposes the data property per the
11 // semantics defined by the specification. When the test is being ran
12 // manually, grant Notification permission first.
14 function assertNotificationDataReflects(value) {
15 var notification = new Notification('Title', { data: value });
17 if (typeof value === 'object')
18 assert_object_equals(notification.data, value);
19 else
20 assert_equals(notification.data, value);
23 test(function () {
24 // Set notification's data of several type to a structured clone of options's data.
25 assertNotificationDataReflects(true); // Check Boolean type
26 assertNotificationDataReflects(1024); // Check Number type
27 assertNotificationDataReflects(Number.NaN); // Check Number.NaN type
28 assertNotificationDataReflects('any data'); // Check String type
30 var cars = new Array('Saab', 'Volvo', 'BMW');
31 assertNotificationDataReflects(cars); // Check Array type
33 var obj = { first: 'first', second: 'second'};
34 assertNotificationDataReflects(obj); // Check Object
36 // Verifying the exception throwing behavior of the method.
37 assert_throws('DataCloneError', function() {
38 var notification = new Notification('Title', { data: function() { return 1; } });
39 }, 'Set function in data');
41 }, 'Checks the data of several type property exposed on the Notification object.');
42 </script>
43 </body>
44 </html>