| OLD | NEW |
| 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 library trydart.incremental_compilation_update_test; | 5 library trydart.incremental_compilation_update_test; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 | 8 |
| 9 import 'dart:async' show | 9 import 'dart:async' show |
| 10 Future; | 10 Future; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 main() { | 286 main() { |
| 287 if (instance == null) { | 287 if (instance == null) { |
| 288 instance = new C(); | 288 instance = new C(); |
| 289 } | 289 } |
| 290 instance.m(); | 290 instance.m(); |
| 291 } | 291 } |
| 292 """, | 292 """, |
| 293 const <String> ['v2']), | 293 const <String> ['v2']), |
| 294 ], | 294 ], |
| 295 | 295 |
| 296 // Test that deleting a top-level method works. |
| 297 const <ProgramResult>[ |
| 298 const ProgramResult( |
| 299 """ |
| 300 toplevel() { |
| 301 print('v1'); |
| 302 } |
| 303 class C { |
| 304 m() { |
| 305 try { |
| 306 toplevel(); |
| 307 } catch (e) { |
| 308 print('v2'); |
| 309 } |
| 310 } |
| 311 } |
| 312 var instance; |
| 313 main() { |
| 314 if (instance == null) { |
| 315 instance = new C(); |
| 316 } |
| 317 instance.m(); |
| 318 } |
| 319 """, |
| 320 const <String> ['v1']), |
| 321 const ProgramResult( |
| 322 """ |
| 323 class C { |
| 324 m() { |
| 325 try { |
| 326 toplevel(); |
| 327 } catch (e) { |
| 328 print('v2'); |
| 329 } |
| 330 } |
| 331 } |
| 332 var instance; |
| 333 main() { |
| 334 if (instance == null) { |
| 335 instance = new C(); |
| 336 } |
| 337 instance.m(); |
| 338 } |
| 339 """, |
| 340 const <String> ['v2']), |
| 341 ], |
| 342 |
| 343 |
| 344 |
| 296 ]; | 345 ]; |
| 297 | 346 |
| 298 void main() { | 347 void main() { |
| 299 listener.start(); | 348 listener.start(); |
| 300 | 349 |
| 301 return asyncTest(() => Future.forEach(tests, compileAndRun)); | 350 return asyncTest(() => Future.forEach(tests, compileAndRun)); |
| 302 } | 351 } |
| 303 | 352 |
| 304 Future compileAndRun(List<ProgramResult> programs) { | 353 Future compileAndRun(List<ProgramResult> programs) { |
| 305 var status = new DivElement(); | 354 var status = new DivElement(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 406 |
| 358 void logger(x) { | 407 void logger(x) { |
| 359 print(x); | 408 print(x); |
| 360 bool isCheckedMode = false; | 409 bool isCheckedMode = false; |
| 361 assert(isCheckedMode = true); | 410 assert(isCheckedMode = true); |
| 362 int timeout = isCheckedMode ? TIMEOUT * 2 : TIMEOUT; | 411 int timeout = isCheckedMode ? TIMEOUT * 2 : TIMEOUT; |
| 363 if (listener.elapsed > timeout) { | 412 if (listener.elapsed > timeout) { |
| 364 throw 'Test timed out.'; | 413 throw 'Test timed out.'; |
| 365 } | 414 } |
| 366 } | 415 } |
| OLD | NEW |