Index: tests/html/fontface_loaded_test.dart |
diff --git a/tests/html/fontface_loaded_test.dart b/tests/html/fontface_loaded_test.dart |
index d1926880ae89c66f7f052293d236fb2906193cb7..8a80f5d4d500fc8cd7938e107f2b6c2a6f8358ba 100644 |
--- a/tests/html/fontface_loaded_test.dart |
+++ b/tests/html/fontface_loaded_test.dart |
@@ -8,17 +8,18 @@ import 'dart:isolate'; |
import 'dart:html'; |
class NullTreeSanitizer implements NodeTreeSanitizer { |
- void sanitizeTree(Node node) {} |
+ void sanitizeTree(Node node) {} |
} |
main() { |
useHtmlConfiguration(); |
- var style = new Element.html(''' |
+ var style = new Element.html( |
+ ''' |
<style> |
@font-face { |
font-family: 'Ahem'; |
- src: url(../../resources/Ahem.ttf); |
+ src: url(/root_dart/tests/html/Ahem.ttf); |
font-style: italic; |
font-weight: 300; |
unicode-range: U+0-3FF; |
@@ -27,20 +28,26 @@ main() { |
/* font-stretch property is not supported */ |
} |
</style> |
- ''', treeSanitizer: new NullTreeSanitizer()); |
+ ''', |
+ treeSanitizer: new NullTreeSanitizer()); |
document.head.append(style); |
- |
test('document fonts - temporary', () { |
var atLeastOneFont = false; |
+ var loaded = []; |
document.fonts.forEach((FontFace fontFace, _, __) { |
atLeastOneFont = true; |
Future f1 = fontFace.loaded; |
Future f2 = fontFace.loaded; |
- expect(f1, equals(f2)); // Repeated calls should answer the same Future. |
- |
- expect(fontFace.load(), throws); |
+ loaded.add(fontFace.load()); |
+ loaded.add(f1); |
+ loaded.add(f2); |
}); |
expect(atLeastOneFont, isTrue); |
+ return Future.wait(loaded).then(expectAsync((_) { |
+ document.fonts.forEach((fontFace, _, __) { |
+ expect(fontFace.status, 'loaded'); |
+ }); |
+ })); |
}); |
} |