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

Unified Diff: tests/html/node_model_test.dart

Issue 12899003: Attempting to stabilize node_model_test on IE9 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/node_model_test.dart
diff --git a/tests/html/node_model_test.dart b/tests/html/node_model_test.dart
index 64cab4b5733ca243d801f298bfa665748dc68ad8..0e1b23afe5474dff9fcf6b2db298f8b043f15fec 100644
--- a/tests/html/node_model_test.dart
+++ b/tests/html/node_model_test.dart
@@ -8,8 +8,9 @@ import 'dart:html';
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_config.dart';
+var stepDuration;
Future get nextStep {
- return new Future.delayed(new Duration());
+ return new Future.delayed(stepDuration);
}
class ModelTracker {
@@ -34,11 +35,24 @@ class ModelTracker {
void clearModel() {
element.clearModel();
}
+
+ void remove() {
+ element.remove();
+ }
}
main() {
useHtmlConfiguration();
+ if (MutationObserver.supported) {
+ stepDuration = new Duration();
+ } else {
+ // Need to step after the tree update notifications, but on IE9 these may
+ // get polyfilled to use setTimeout(0). So use a longer timer to try to
+ // get a later callback.
+ stepDuration = new Duration(milliseconds: 15);
+ }
+
test('basic top down', () {
var a = new DivElement();
var b = new SpanElement();
@@ -99,6 +113,9 @@ main() {
c.clearModel();
expect(d.model, model2);
+
+ a.remove();
+ return nextStep;
});
});
@@ -140,6 +157,9 @@ main() {
c.clearModel();
expect(c.models, [model, cModel, model]);
expect(d.models, [model, cModel, model]);
+
+ a.remove();
+ return nextStep;
});
});
@@ -164,6 +184,9 @@ main() {
expect(b.models, [aModel]);
expect(c.models, [cModel]);
expect(d.models, [cModel]);
+
+ a.remove();
+ return nextStep;
});
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698