36eb8a8928
TBR BUG= Review URL: https://codereview.chromium.org//12091007 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17684 260f80e4-7a28-3924-810f-c04153c831b5
36 lines
895 B
Dart
36 lines
895 B
Dart
// 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);
|
|
});
|
|
}
|