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

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

Issue 927563002: Fix hidden try tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | tests/try/poi/library_updater_test.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) 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 element diff. 5 /// Test of element diff.
6 library trydart.diff_test; 6 library trydart.diff_test;
7 7
8 import 'dart:async' show 8 import 'dart:async' show
9 Future; 9 Future;
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 Future<List<Difference>> testDifference( 73 Future<List<Difference>> testDifference(
74 String beforeSource, 74 String beforeSource,
75 String afterSource) { 75 String afterSource) {
76 Uri scriptUri = customUri('main.dart'); 76 Uri scriptUri = customUri('main.dart');
77 MockCompiler compiler = compilerFor(beforeSource, scriptUri); 77 MockCompiler compiler = compilerFor(beforeSource, scriptUri);
78 78
79 Future<LibraryElement> future = compiler.libraryLoader.loadLibrary(scriptUri); 79 Future<LibraryElement> future = compiler.libraryLoader.loadLibrary(scriptUri);
80 return future.then((LibraryElement library) { 80 return future.then((LibraryElement library) {
81 Script sourceScript = new Script( 81 Script sourceScript = new Script(
82 scriptUri, scriptUri, new StringSourceFile('$scriptUri', afterSource)); 82 scriptUri, scriptUri,
83 new StringSourceFile.fromUri(scriptUri, afterSource));
83 var dartPrivacyIsBroken = compiler.libraryLoader; 84 var dartPrivacyIsBroken = compiler.libraryLoader;
84 LibraryElement newLibrary = dartPrivacyIsBroken.createLibrarySync( 85 LibraryElement newLibrary = dartPrivacyIsBroken.createLibrarySync(
85 null, sourceScript, scriptUri); 86 null, sourceScript, scriptUri);
86 return computeDifference(library, newLibrary); 87 return computeDifference(library, newLibrary);
87 }); 88 });
88 } 89 }
89 90
90 Future testData(Map data) { 91 Future testData(Map data) {
91 String beforeSource = data['beforeSource']; 92 String beforeSource = data['beforeSource'];
92 String afterSource = data['afterSource']; 93 String afterSource = data['afterSource'];
(...skipping 21 matching lines...) Expand all
114 expectedBeforeName, elementNameOrNull(difference.before)); 115 expectedBeforeName, elementNameOrNull(difference.before));
115 Expect.stringEquals(expectedAfterName, elementNameOrNull(difference.after)); 116 Expect.stringEquals(expectedAfterName, elementNameOrNull(difference.after));
116 print(difference); 117 print(difference);
117 } 118 }
118 Expect.isFalse(iterator.moveNext()); 119 Expect.isFalse(iterator.moveNext());
119 } 120 }
120 121
121 void main() { 122 void main() {
122 asyncTest(() => Future.forEach(TEST_DATA, testData)); 123 asyncTest(() => Future.forEach(TEST_DATA, testData));
123 } 124 }
OLDNEW
« no previous file with comments | « no previous file | tests/try/poi/library_updater_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698