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

Side by Side Diff: pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart

Issue 2993113003: Revert "Switch FE to use the libraries.json format." (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// Integration test that runs the incremental compiler, runs the compiled 5 /// Integration test that runs the incremental compiler, runs the compiled
6 /// program, incrementally rebuild portions of the app, and triggers a hot 6 /// program, incrementally rebuild portions of the app, and triggers a hot
7 /// reload on the running program. 7 /// reload on the running program.
8 library front_end.incremental.hot_reload_e2e_test; 8 library front_end.incremental.hot_reload_e2e_test;
9 9
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 var dartVm = Uri.base.resolve(Platform.resolvedExecutable); 170 var dartVm = Uri.base.resolve(Platform.resolvedExecutable);
171 var sdkRoot = dartVm.resolve("patched_sdk/"); 171 var sdkRoot = dartVm.resolve("patched_sdk/");
172 172
173 Future<IncrementalKernelGenerator> createIncrementalCompiler( 173 Future<IncrementalKernelGenerator> createIncrementalCompiler(
174 String entry, FileSystem fs) { 174 String entry, FileSystem fs) {
175 var entryUri = Uri.base.resolve(entry); 175 var entryUri = Uri.base.resolve(entry);
176 var options = new CompilerOptions() 176 var options = new CompilerOptions()
177 ..sdkRoot = sdkRoot 177 ..sdkRoot = sdkRoot
178 ..sdkSummary = sdkRoot.resolve('outline.dill')
178 ..packagesFileUri = Uri.parse('file:///.packages') 179 ..packagesFileUri = Uri.parse('file:///.packages')
179 ..strongMode = false 180 ..strongMode = false
180 ..compileSdk = true // the incremental generator requires the sdk sources 181 ..dartLibraries = loadDartLibraries()
181 ..fileSystem = fs 182 ..fileSystem = fs
182 ..byteStore = new MemoryByteStore(); 183 ..byteStore = new MemoryByteStore();
183 return IncrementalKernelGenerator.newInstance(options, entryUri); 184 return IncrementalKernelGenerator.newInstance(options, entryUri);
184 } 185 }
185 186
187 Map<String, Uri> loadDartLibraries() {
188 var libraries = sdkRoot.resolve('lib/libraries.json');
189 var map =
190 JSON.decode(new File.fromUri(libraries).readAsStringSync())['libraries'];
191 var dartLibraries = <String, Uri>{};
192 map.forEach((k, v) => dartLibraries[k] = libraries.resolve(v));
193 return dartLibraries;
194 }
195
186 Future<bool> rebuild(IncrementalKernelGenerator compiler, Uri outputUri) async { 196 Future<bool> rebuild(IncrementalKernelGenerator compiler, Uri outputUri) async {
187 compiler.invalidate(Uri.parse("file:///a.dart")); 197 compiler.invalidate(Uri.parse("file:///a.dart"));
188 compiler.invalidate(Uri.parse("file:///b.dart")); 198 compiler.invalidate(Uri.parse("file:///b.dart"));
189 var program = (await compiler.computeDelta()).newProgram; 199 var program = (await compiler.computeDelta()).newProgram;
190 if (program != null && !program.libraries.isEmpty) { 200 if (program != null && !program.libraries.isEmpty) {
191 await writeProgram(program, outputUri); 201 await writeProgram(program, outputUri);
192 return true; 202 return true;
193 } 203 }
194 return false; 204 return false;
195 } 205 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 249
240 f() => "$line part2"; 250 f() => "$line part2";
241 '''; 251 ''';
242 252
243 const sourceB = r''' 253 const sourceB = r'''
244 get line => "part1"; 254 get line => "part1";
245 '''; 255 ''';
246 256
247 RegExp observatoryPortRegExp = 257 RegExp observatoryPortRegExp =
248 new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)/"); 258 new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)/");
OLDNEW
« no previous file with comments | « pkg/front_end/test/src/incremental/file_state_test.dart ('k') | pkg/front_end/test/src/incremental/kernel_driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698