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

Side by Side Diff: LayoutTests/http/tests/notifications/serviceworkerregistration-document-invalid-language.html

Issue 1110223002: Use and add layout tests for BCP 47 language tag syntax validation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>Notifications: ServiceWorkerRegistration.showNotification() should va lidate the syntax of the language tag of a notification.</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 <script src="resources/test-helpers.js"></script>
9 </head>
10 <body>
11 <script>
12 // Tests that the showNotification() function validates the language tag o f the
13 // notification, by making sure that the tag is empty when an invalid BCP 47
14 // language has been supplied on getting the notifications.
15
16 async_test(function(test) {
17 var scope = 'resources/spec/' + location.pathname,
18 script = 'resources/instrumentation-service-worker.js';
19
20 testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
21
22 var registration = null;
23 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi on(info) {
24 registration = info.registration;
25
26 // (1) Display a Web Notification from the document.
27 return registration.showNotification(scope, {
28 lang: 'invalid language'
29 });
30 }).then(function() {
31 return registration.getNotifications();
32 }).then(function(notifications) {
33 assert_equals(notifications.length, 1);
34 assert_equals(notifications[0].lang, '');
35
36 test.done();
37 }).catch(unreached_rejection(test));
38
39 }, 'ServiceWorkerRegistration.showNotification() should validate the synta x of the language tag of a notification.');
40 </script>
41 </body>
42 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/notifications/notification-properties.html ('k') | Source/modules/mediasource/TrackDefault.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698