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

Side by Side Diff: test/codegen/lib/html/fontface_loaded_test.dart

Issue 1930043002: Add all dart:html tests from the sdk to test/codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal Created 4 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
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 '''
19 <style>
20 @font-face {
21 font-family: 'Ahem';
22 src: url(/root_dart/tests/html/Ahem.ttf);
23 font-style: italic;
24 font-weight: 300;
25 unicode-range: U+0-3FF;
26 font-variant: small-caps;
27 -webkit-font-feature-settings: "dlig" 1;
28 /* font-stretch property is not supported */
29 }
30 </style>
31 ''',
32 treeSanitizer: new NullTreeSanitizer());
33 document.head.append(style);
34
35 test('document fonts - temporary', () {
36 var atLeastOneFont = false;
37 var loaded = [];
38 document.fonts.forEach((FontFace fontFace, _, __) {
39 atLeastOneFont = true;
40 Future f1 = fontFace.loaded;
41 Future f2 = fontFace.loaded;
42 loaded.add(fontFace.load());
43 loaded.add(f1);
44 loaded.add(f2);
45 });
46 expect(atLeastOneFont, isTrue);
47 return Future.wait(loaded).then(expectAsync((_) {
48 document.fonts.forEach((fontFace, _, __) {
49 expect(fontFace.status, 'loaded');
50 });
51 }));
52 });
53 }
OLDNEW
« no previous file with comments | « test/codegen/lib/html/filteredelementlist_test.dart ('k') | test/codegen/lib/html/fontface_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698