Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 ..compileSdk = true // the incremental generator requires the sdk sources | 180 ..compileSdk = true // the incremental generator requires the sdk sources |
| 181 ..fileSystem = fs | 181 ..fileSystem = fs |
| 182 ..byteStore = new MemoryByteStore(); | 182 ..byteStore = new MemoryByteStore(); |
| 183 return IncrementalKernelGenerator.newInstance(options, entryUri); | 183 return IncrementalKernelGenerator.newInstance(options, entryUri); |
| 184 } | 184 } |
| 185 | 185 |
| 186 Future<bool> rebuild(IncrementalKernelGenerator compiler, Uri outputUri) async { | 186 Future<bool> rebuild(IncrementalKernelGenerator compiler, Uri outputUri) async { |
| 187 compiler.invalidate(Uri.parse("file:///a.dart")); | 187 compiler.invalidate(Uri.parse("file:///a.dart")); |
| 188 compiler.invalidate(Uri.parse("file:///b.dart")); | 188 compiler.invalidate(Uri.parse("file:///b.dart")); |
| 189 var program = (await compiler.computeDelta()).newProgram; | 189 var program = (await compiler.computeDelta()).newProgram; |
| 190 compiler.acceptLastDelta(); | |
|
Siggi Cherem (dart-lang)
2017/08/10 18:31:15
A couple suggestions: feel free to ignore if you d
scheglov
2017/08/10 19:28:39
I moved this line into hotReload() and setUp().
I
| |
| 190 if (program != null && !program.libraries.isEmpty) { | 191 if (program != null && !program.libraries.isEmpty) { |
| 191 await writeProgram(program, outputUri); | 192 await writeProgram(program, outputUri); |
| 192 return true; | 193 return true; |
| 193 } | 194 } |
| 194 return false; | 195 return false; |
| 195 } | 196 } |
| 196 | 197 |
| 197 Future<Null> writeProgram(Program program, Uri outputUri) async { | 198 Future<Null> writeProgram(Program program, Uri outputUri) async { |
| 198 var sink = new File.fromUri(outputUri).openWrite(); | 199 var sink = new File.fromUri(outputUri).openWrite(); |
| 199 // TODO(sigmund): the incremental generator should always filter these | 200 // TODO(sigmund): the incremental generator should always filter these |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 | 240 |
| 240 f() => "$line part2"; | 241 f() => "$line part2"; |
| 241 '''; | 242 '''; |
| 242 | 243 |
| 243 const sourceB = r''' | 244 const sourceB = r''' |
| 244 get line => "part1"; | 245 get line => "part1"; |
| 245 '''; | 246 '''; |
| 246 | 247 |
| 247 RegExp observatoryPortRegExp = | 248 RegExp observatoryPortRegExp = |
| 248 new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)/"); | 249 new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)/"); |
| OLD | NEW |