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

Side by Side Diff: utils/tests/archive/utils_test.dart

Issue 10825139: Free the C memory for ArchiveInputStream when the stream is garbage collected. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix a renamed function Created 8 years, 4 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
« utils/archive/input_stream.dart ('K') | « utils/archive/utils.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 #library('utils_test');
6
7 #import('../../../lib/unittest/unittest.dart');
8 #import('../../archive/utils.dart');
9
10 main() {
11 group('attachFinalizer', () {
12 test('calls the finalizer eventually once the object is collected', () {
13 var finalized = null;
14
15 void finalizer(String data) {
16 finalized = data;
17 }
18
19 while (finalized == null) {
20 var list = [1, 2, 3];
21 attachFinalizer(list, finalizer, 'finally finalized!');
22 }
23
24 expect(finalized, equals('finally finalized!'));
25 });
26
27 test("doesn't call the finalizer while the object is in scope", () {
28 var finalized = null;
29
30 void finalizer(String data) {
31 finalized = data;
32 }
33
34 var list = [1, 2, 3];
35 attachFinalizer(list, finalizer, 'finally finalized!');
36 expect(finalized, isNull);
37 });
38 });
39 }
OLDNEW
« utils/archive/input_stream.dart ('K') | « utils/archive/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698