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

Side by Side Diff: tests/lib/async/deferred/deferred_api_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test that that the basic API for deferred/lazy loading works. This 5 // Test that that the basic API for deferred/lazy loading works. This
6 // test deliberately does not test that the deferred elements throw a 6 // test deliberately does not test that the deferred elements throw a
7 // NoSuchMethodError before the deferred library is loaded. This 7 // NoSuchMethodError before the deferred library is loaded. This
8 // makes it possible to pass this test without having implemented 8 // makes it possible to pass this test without having implemented
9 // deferred loading correctly. 9 // deferred loading correctly.
10 10
11 import "package:expect/expect.dart";
11 import 'dart:async'; 12 import 'dart:async';
12 13
13 @lazy 14 @lazy
14 import 'deferred_api_library.dart'; 15 import 'deferred_api_library.dart';
15 16
16 const lazy = const DeferredLibrary('deferred_api_library'); 17 const lazy = const DeferredLibrary('deferred_api_library');
17 18
18 main() { 19 main() {
19 print('unittest-suite-wait-for-done'); 20 print('unittest-suite-wait-for-done');
20 21
21 int counter = 0; 22 int counter = 0;
22 lazy.load().then((bool didLoad) { 23 lazy.load().then((bool didLoad) {
23 Expect.isTrue(didLoad); 24 Expect.isTrue(didLoad);
24 Expect.equals(1, ++counter); 25 Expect.equals(1, ++counter);
25 Expect.equals(42, foo('b')); 26 Expect.equals(42, foo('b'));
26 print('lazy was loaded'); 27 print('lazy was loaded');
27 }); 28 });
28 Expect.equals(0, counter); 29 Expect.equals(0, counter);
29 lazy.load().then((bool didLoad) { 30 lazy.load().then((bool didLoad) {
30 Expect.isFalse(didLoad); 31 Expect.isFalse(didLoad);
31 Expect.equals(2, ++counter); 32 Expect.equals(2, ++counter);
32 Expect.equals(42, foo('b')); 33 Expect.equals(42, foo('b'));
33 print('lazy was loaded'); 34 print('lazy was loaded');
34 print('unittest-suite-success'); 35 print('unittest-suite-success');
35 }); 36 });
36 Expect.equals(0, counter); 37 Expect.equals(0, counter);
37 } 38 }
OLDNEW
« no previous file with comments | « tests/language/wrong_number_type_arguments_test.dart ('k') | tests/lib/async/future_delayed_error_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698