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

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

Issue 658903005: Reapply "Stop suppressing generation of bindings with Promise. Add some tests for DOM APIs that ans… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('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 library fontface_loaded_test;
2
3 import 'package:unittest/unittest.dart';
4 import 'package:unittest/html_config.dart';
5
6 import 'dart:async';
7 import 'dart:isolate';
8 import 'dart:html';
9
10 class NullTreeSanitizer implements NodeTreeSanitizer {
11 void sanitizeTree(Node node) {}
12 }
13
14 main() {
15 useHtmlConfiguration();
16
17 var style = new Element.html('''
18 <style>
19 @font-face {
20 font-family: 'Ahem';
21 src: url(../../resources/Ahem.ttf);
22 font-style: italic;
23 font-weight: 300;
24 unicode-range: U+0-3FF;
25 font-variant: small-caps;
26 -webkit-font-feature-settings: "dlig" 1;
27 /* font-stretch property is not supported */
28 }
29 </style>
30 ''', treeSanitizer: new NullTreeSanitizer());
31 document.head.append(style);
32
33
34 test('document fonts - temporary', () {
35 var atLeastOneFont = false;
36 document.fonts.forEach((FontFace fontFace, _, __) {
37 atLeastOneFont = true;
38 Future f1 = fontFace.loaded;
39 Future f2 = fontFace.loaded;
40 expect(f1, equals(f2)); // Repeated calls should answer the same Future.
41
42 expect(fontFace.load(), throws);
43 });
44 expect(atLeastOneFont, isTrue);
45 });
46 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698