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

Side by Side Diff: pkg/observe/lib/src/microtask.dart

Issue 23437017: pkg/observe: wrapMicrotask should return the result the provided testCase (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « no previous file | pkg/observe/lib/transform.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) 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 /** 5 /**
6 * *Warning*: this library is **internal**, and APIs are subject to change. 6 * *Warning*: this library is **internal**, and APIs are subject to change.
7 * 7 *
8 * Wraps a callback using [wrapMicrotask] and provides the ability to pump all 8 * Wraps a callback using [wrapMicrotask] and provides the ability to pump all
9 * observable objects and [runAsync] calls via [performMicrotaskCheckpoint]. 9 * observable objects and [runAsync] calls via [performMicrotaskCheckpoint].
10 */ 10 */
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Observable.dirtyCheck(); 42 Observable.dirtyCheck();
43 } 43 }
44 } 44 }
45 45
46 List<Function> _pending = []; 46 List<Function> _pending = [];
47 47
48 /** 48 /**
49 * Wraps the [testCase] in a zone that supports [performMicrotaskCheckpoint], 49 * Wraps the [testCase] in a zone that supports [performMicrotaskCheckpoint],
50 * and returns the test case. 50 * and returns the test case.
51 */ 51 */
52 wrapMicrotask(void testCase()) { 52 wrapMicrotask(testCase()) {
53 return () { 53 return () {
54 runZonedExperimental(() { 54 return runZonedExperimental(() {
55 try { 55 try {
56 testCase(); 56 return testCase();
57 } finally { 57 } finally {
58 performMicrotaskCheckpoint(); 58 performMicrotaskCheckpoint();
59 } 59 }
60 }, onRunAsync: (callback) => _pending.add(callback)); 60 }, onRunAsync: (callback) => _pending.add(callback));
61 }; 61 };
62 } 62 }
OLDNEW
« no previous file with comments | « no previous file | pkg/observe/lib/transform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698