| 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 /** | 5 /** |
| 6 * This test verifies that if reanalysis is performed while reanalysis is in | 6 * This test verifies that if reanalysis is performed while reanalysis is in |
| 7 * progress, no problems occur. | 7 * progress, no problems occur. |
| 8 * | 8 * |
| 9 * See dartbug.com/21448. | 9 * See dartbug.com/21448. |
| 10 */ | 10 */ |
| 11 library test.integration.analysis.reanalyze_concurrent; | 11 library test.integration.analysis.reanalyze_concurrent; |
| 12 | 12 |
| 13 import 'dart:async'; | 13 import 'dart:async'; |
| 14 | 14 |
| 15 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 15 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 16 | 16 |
| 17 import '../../utils.dart'; |
| 17 import '../integration_tests.dart'; | 18 import '../integration_tests.dart'; |
| 18 | 19 |
| 19 main() { | 20 main() { |
| 21 initializeTestEnvironment(); |
| 20 defineReflectiveTests(Test); | 22 defineReflectiveTests(Test); |
| 21 } | 23 } |
| 22 | 24 |
| 23 @reflectiveTest | 25 @reflectiveTest |
| 24 class Test extends AbstractAnalysisServerIntegrationTest { | 26 class Test extends AbstractAnalysisServerIntegrationTest { |
| 25 test_reanalyze_concurrent() { | 27 test_reanalyze_concurrent() { |
| 26 String pathname = sourcePath('test.dart'); | 28 String pathname = sourcePath('test.dart'); |
| 27 String text = ''' | 29 String text = ''' |
| 28 // Do a bunch of imports so that analysis has some work to do. | 30 // Do a bunch of imports so that analysis has some work to do. |
| 29 import 'dart:io'; | 31 import 'dart:io'; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 sendAnalysisReanalyze(); | 42 sendAnalysisReanalyze(); |
| 41 return analysisFinished.then((_) { | 43 return analysisFinished.then((_) { |
| 42 // Now that reanalysis has finished, give the server an extra second | 44 // Now that reanalysis has finished, give the server an extra second |
| 43 // to make sure it doesn't crash. | 45 // to make sure it doesn't crash. |
| 44 return new Future.delayed(new Duration(seconds: 1)); | 46 return new Future.delayed(new Duration(seconds: 1)); |
| 45 }); | 47 }); |
| 46 }); | 48 }); |
| 47 }); | 49 }); |
| 48 } | 50 } |
| 49 } | 51 } |
| OLD | NEW |