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

Side by Side Diff: dart/tests/try/poi/apply_updates_test.dart

Issue 757043002: Various clean up. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 of FunctionUpdate by pretty printing the updated element before and 5 // Test of FunctionUpdate by pretty printing the updated element before and
6 // after. 6 // after.
7 library trydart.library_updater_test; 7 library trydart.library_updater_test;
8 8
9 import 'dart:convert' show 9 import 'dart:convert' show
10 UTF8; 10 UTF8;
(...skipping 14 matching lines...) Expand all
25 class ApplyUpdateTestCase extends LibraryUpdaterTestCase { 25 class ApplyUpdateTestCase extends LibraryUpdaterTestCase {
26 final String expectedUpdate; 26 final String expectedUpdate;
27 27
28 ApplyUpdateTestCase( 28 ApplyUpdateTestCase(
29 {String before, 29 {String before,
30 String after, 30 String after,
31 String update}) 31 String update})
32 : this.expectedUpdate = update, 32 : this.expectedUpdate = update,
33 super(before: before, after: after, canReuse: true); 33 super(before: before, after: after, canReuse: true);
34 34
35 Future run() => mainApp.then((LibraryElement library) { 35 Future run() => loadMainApp().then((LibraryElement library) {
36 // Capture the current version of [before] before invoking the [updater]. 36 // Capture the current version of [before] before invoking the [updater].
37 PartialFunctionElement before = library.localLookup(expectedUpdate); 37 PartialFunctionElement before = library.localLookup(expectedUpdate);
38 var beforeNode = before.parseNode(compiler); 38 var beforeNode = before.parseNode(compiler);
39 39
40 LibraryUpdater updater = 40 LibraryUpdater updater =
41 new LibraryUpdater(this.compiler, null, scriptUri, nolog, nolog); 41 new LibraryUpdater(this.compiler, null, scriptUri, nolog, nolog);
42 bool actualCanReuse = 42 bool actualCanReuse =
43 updater.canReuseLibrary(library, UTF8.encode(newSource)); 43 updater.canReuseLibrary(library, UTF8.encode(newSource));
44 Expect.equals(expectedCanReuse, actualCanReuse); 44 Expect.equals(expectedCanReuse, actualCanReuse);
45 45
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 new ApplyUpdateTestCase( 90 new ApplyUpdateTestCase(
91 before: 'main(){}', 91 before: 'main(){}',
92 after: 'main()=>null;', 92 after: 'main()=>null;',
93 update: 'main'), 93 update: 'main'),
94 94
95 // TODO(ahe): When supporting class members, test abstract methods. 95 // TODO(ahe): When supporting class members, test abstract methods.
96 ] 96 ]
97 ); 97 );
98 } 98 }
OLDNEW
« no previous file with comments | « dart/site/try/poi/scope_information_visitor.dart ('k') | dart/tests/try/poi/compiler_test_case.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698