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

Unified Diff: tests/html/mutationobserver_test.dart

Issue 11647044: Adding annotation for partial browser support and example implementation for MutationObservers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added experimental annotation to MutationObserver. Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/mutationobserver_test.dart
diff --git a/tests/html/mutationobserver_test.dart b/tests/html/mutationobserver_test.dart
index 6f93d847c0b30562f103dfbaf5c1c5c26b3232bc..e23a04cafaea70d1abd1a2dbe703fc7838e7d567 100644
--- a/tests/html/mutationobserver_test.dart
+++ b/tests/html/mutationobserver_test.dart
@@ -4,7 +4,7 @@
library mutationobserver_test;
import '../../pkg/unittest/lib/unittest.dart';
-import '../../pkg/unittest/lib/html_config.dart';
+import '../../pkg/unittest/lib/html_individual_config.dart';
import 'dart:html';
/**
@@ -12,10 +12,17 @@ import 'dart:html';
* checks, not a complete test suite.
*/
main() {
- useHtmlConfiguration();
+ useHtmlIndividualConfiguration();
- group('childList', () {
+ group('supported', () {
+ test('supported', () {
+ expect(MutationObserver.supported, true);
+ });
+ });
+
+ var expectation = MutationObserver.supported ? returnsNormally : throws;
+ group('childList', () {
mutationCallback(count, expectation) {
var done = false;
var nodes = [];
@@ -33,18 +40,26 @@ main() {
}
}
+ // If it's not supported, don't block waiting for it.
+ if (!MutationObserver.supported) {
+ return () => done;
+ }
+
return expectAsyncUntil2(callback, () => done);
}
test('empty options is syntax error', () {
+ expect(() {
var mutationObserver = new MutationObserver(
(mutations, observer) { expect(false, isTrue,
reason: 'Should not be reached'); });
expect(() { mutationObserver.observe(document, {}); },
throws);
- });
+ }, expectation);
+ });
test('direct-parallel options-map', () {
+ expect(() {
var container = new DivElement();
var div1 = new DivElement();
var div2 = new DivElement();
@@ -54,9 +69,11 @@ main() {
container.nodes.add(div1);
container.nodes.add(div2);
- });
+ }, expectation);
+ });
test('direct-parallel options-named', () {
+ expect(() {
var container = new DivElement();
var div1 = new DivElement();
var div2 = new DivElement();
@@ -66,9 +83,11 @@ main() {
container.nodes.add(div1);
container.nodes.add(div2);
- });
+ }, expectation);
+ });
test('direct-nested options-named', () {
+ expect(() {
var container = new DivElement();
var div1 = new DivElement();
var div2 = new DivElement();
@@ -78,10 +97,12 @@ main() {
container.nodes.add(div1);
div1.nodes.add(div2);
- });
+ }, expectation);
+ });
test('subtree options-map', () {
+ expect(() {
var container = new DivElement();
var div1 = new DivElement();
var div2 = new DivElement();
@@ -92,9 +113,11 @@ main() {
container.nodes.add(div1);
div1.nodes.add(div2);
- });
+ }, expectation);
+ });
test('subtree options-named', () {
+ expect(() {
var container = new DivElement();
var div1 = new DivElement();
var div2 = new DivElement();
@@ -104,6 +127,7 @@ main() {
container.nodes.add(div1);
div1.nodes.add(div2);
- });
+ }, expectation);
+ });
});
}
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698