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

Unified Diff: tests/html/microtask_test.dart

Issue 12087004: Changing window.requestLayoutFrame into a microtask API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « tests/html/measurement_test.dart ('k') | tools/dom/src/Measurement.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/microtask_test.dart
diff --git a/tests/html/microtask_test.dart b/tests/html/microtask_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0dfcc53402b1af737ec8fe8a3949e6db3113373e
--- /dev/null
+++ b/tests/html/microtask_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library microtask_;
+import '../../pkg/unittest/lib/unittest.dart';
+import '../../pkg/unittest/lib/html_config.dart';
+import 'dart:html';
+
+main() {
+ useHtmlConfiguration();
+
+ test('setImmediate', () {
+ var timeoutCalled = false;
+ var rafCalled = false;
+ var immediateCalled = false;
+
+ window.setTimeout(expectAsync0(() {
+ timeoutCalled = true;
+ expect(immediateCalled, true);
+ }), 0);
+
+
+ window.requestAnimationFrame((_) {
+ rafCalled = true;
+ });
+
+ window.setImmediate(expectAsync0(() {
+ expect(timeoutCalled, false);
+ expect(rafCalled, false);
+ immediateCalled = true;
+ }));
+ expect(immediateCalled, false);
+ });
+}
« no previous file with comments | « tests/html/measurement_test.dart ('k') | tools/dom/src/Measurement.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698