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

Side by Side Diff: tests/html/notification_test.dart

Issue 1002953005: Fix Notification (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed formatting of the test Created 5 years, 9 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
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/dom.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library notification_test;
6
7 import 'package:unittest/unittest.dart';
8 import 'package:unittest/html_individual_config.dart';
9 import 'dart:html';
10
11 main() {
12 useHtmlIndividualConfiguration();
13
14 group('supported_notification', () {
15 test('supported', () {
16 expect(Notification.supported, true);
17 });
18 });
19
20 group('constructors', () {
21 // Test that we create the notification and that the parameters have
22 // the expected values. Note that these won't actually display, because
23 // we haven't asked for permission, which would have to be done
24 // interactively, so can't run on a bot.
25 test('Notification', () {
26 var expectation = Notification.supported ? returnsNormally : throws;
27 expect(() {
28 var allDefaults = new Notification("Hello world");
29 var allSpecified = new Notification("Deluxe notification",
30 dir: "rtl",
31 body: 'All parameters set',
32 icon: 'icon.png',
33 tag: 'tag',
34 lang: 'en_US');
35 expect(allDefaults is Notification, isTrue);
36 expect(allSpecified is Notification, isTrue);
37 expect(allDefaults.title, "Hello world");
38 expect(allSpecified.title, "Deluxe notification");
39 expect(allSpecified.dir, "rtl");
40 expect(allSpecified.body, "All parameters set");
41 var icon = allSpecified.icon;
42 var tail = Uri.parse(icon).pathSegments.last;
43 expect(tail, "icon.png");
44 expect(allSpecified.tag, "tag");
45 expect(allSpecified.lang, "en_US");
46 }, expectation);
47 });
48 });
49 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/dom.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698