Files
sdk/tests/html/microtask_test.dart
T
efortuna@google.com d7057b2d8c Reapply setTimeout change.
This CL is identical to 18555. The reason it will  work now is the corresponding
dartium change has been checked in.

TBR-blois

BUG=

Review URL: https://codereview.chromium.org//12254046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18562 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 07:40:51 +00:00

37 lines
905 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: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);
});
}