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

Side by Side Diff: lib/unittest/unittest.dart

Issue 10389097: Move dart:dom to dart:dom_deprecated (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes from review Created 8 years, 7 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
« no previous file with comments | « lib/unittest/dom_config.dart ('k') | samples/matrix/matrix_client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * A library for writing dart unit tests. 6 * A library for writing dart unit tests.
7 * 7 *
8 * ##Concepts## 8 * ##Concepts##
9 * 9 *
10 * * Tests: Tests are specified via the top-level function [test], they can be 10 * * Tests: Tests are specified via the top-level function [test], they can be
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 * test('this B.1', () { 60 * test('this B.1', () {
61 * int x = 2 + 3; 61 * int x = 2 + 3;
62 * expect(x).equals(5); 62 * expect(x).equals(5);
63 * }); 63 * });
64 * }); 64 * });
65 * } 65 * }
66 * 66 *
67 * Asynchronous tests: if callbacks expect between 0 and 2 positional arguments. 67 * Asynchronous tests: if callbacks expect between 0 and 2 positional arguments.
68 * 68 *
69 * #import('path-to-dart/lib/unittest/unitest.dart'); 69 * #import('path-to-dart/lib/unittest/unitest.dart');
70 * #import('dart:dom'); 70 * #import('dart:dom_deprecated');
71 * main() { 71 * main() {
72 * test('calllback is executed once', () { 72 * test('calllback is executed once', () {
73 * // wrap the callback of an asynchronous call with [expectAsync0] if 73 * // wrap the callback of an asynchronous call with [expectAsync0] if
74 * // the callback takes 0 arguments... 74 * // the callback takes 0 arguments...
75 * window.setTimeout(expectAsync0(() { 75 * window.setTimeout(expectAsync0(() {
76 * int x = 2 + 3; 76 * int x = 2 + 3;
77 * expect(x).equals(5); 77 * expect(x).equals(5);
78 * }), 0); 78 * }), 0);
79 * }); 79 * });
80 * 80 *
(...skipping 11 matching lines...) Expand all
92 * depending on the number of positional arguments of the callback. In the 92 * depending on the number of positional arguments of the callback. In the
93 * future, we plan to expose a single `expectAsync` function that can be used 93 * future, we plan to expose a single `expectAsync` function that can be used
94 * regardless of the number of positional arguments. This requires new langauge 94 * regardless of the number of positional arguments. This requires new langauge
95 * features or fixes to the current spec (e.g. see dartbug.com/2706). 95 * features or fixes to the current spec (e.g. see dartbug.com/2706).
96 * 96 *
97 * Meanwhile, we plan to add this alternative API for callbacks of more than 2 97 * Meanwhile, we plan to add this alternative API for callbacks of more than 2
98 * arguments or that take named parameters. (this is not implemented yet, 98 * arguments or that take named parameters. (this is not implemented yet,
99 * but will be coming here soon). 99 * but will be coming here soon).
100 * 100 *
101 * #import('path-to-dart/lib/unittest/unitest.dart'); 101 * #import('path-to-dart/lib/unittest/unitest.dart');
102 * #import('dart:dom'); 102 * #import('dart:dom_deprecated');
103 * main() { 103 * main() {
104 * test('calllback is executed', () { 104 * test('calllback is executed', () {
105 * // indicate ahead of time that an async callback is expected. 105 * // indicate ahead of time that an async callback is expected.
106 * var async = startAsync(); 106 * var async = startAsync();
107 * window.setTimeout(() { 107 * window.setTimeout(() {
108 * // Guard the body of the callback, so errors are propagated 108 * // Guard the body of the callback, so errors are propagated
109 * // correctly 109 * // correctly
110 * guardAsync(() { 110 * guardAsync(() {
111 * int x = 2 + 3; 111 * int x = 2 + 3;
112 * expect(x).equals(5); 112 * expect(x).equals(5);
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 } 567 }
568 _config.onInit(); 568 _config.onInit();
569 569
570 // Immediately queue the suite up. It will run after a timeout (i.e. after 570 // Immediately queue the suite up. It will run after a timeout (i.e. after
571 // main() has returned). 571 // main() has returned).
572 _defer(_runTests); 572 _defer(_runTests);
573 } 573 }
574 574
575 /** Signature for a test function. */ 575 /** Signature for a test function. */
576 typedef void TestFunction(); 576 typedef void TestFunction();
OLDNEW
« no previous file with comments | « lib/unittest/dom_config.dart ('k') | samples/matrix/matrix_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698