| 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..79adb284c72dd6dfa9a922b3145656993195c9a3
|
| --- /dev/null
|
| +++ b/tests/html/microtask_test.dart
|
| @@ -0,0 +1,36 @@
|
| +// 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:async';
|
| +import 'dart:html';
|
| +
|
| +main() {
|
| + useHtmlConfiguration();
|
| +
|
| + test('setImmediate', () {
|
| + var timeoutCalled = false;
|
| + var rafCalled = false;
|
| + var immediateCalled = false;
|
| +
|
| + Timer.run(expectAsync0(() {
|
| + timeoutCalled = true;
|
| + expect(immediateCalled, true);
|
| + }));
|
| +
|
| +
|
| + window.requestAnimationFrame((_) {
|
| + rafCalled = true;
|
| + });
|
| +
|
| + window.setImmediate(expectAsync0(() {
|
| + expect(timeoutCalled, false);
|
| + expect(rafCalled, false);
|
| + immediateCalled = true;
|
| + }));
|
| + expect(immediateCalled, false);
|
| + });
|
| +}
|
|
|