| 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 test.integration.completion.domain; | 5 library test.integration.completion.domain; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
| 10 import 'package:analysis_testing/reflective_tests.dart'; | 10 import 'package:analysis_testing/reflective_tests.dart'; |
| 11 import 'package:unittest/unittest.dart'; | 11 import 'package:unittest/unittest.dart'; |
| 12 | 12 |
| 13 import 'integration_tests.dart'; | 13 import 'integration_tests.dart'; |
| 14 | 14 |
| 15 @ReflectiveTestCase() | 15 @ReflectiveTestCase() |
| 16 class CompletionDomainIntegrationTest extends | 16 class CompletionDomainIntegrationTest extends |
| 17 AbstractAnalysisServerIntegrationTest { | 17 AbstractAnalysisServerIntegrationTest { |
| 18 fail_test_getSuggestions_string_var() { | 18 fail_test_getSuggestions_string_var() { |
| 19 // See dartbug.com/20188 | 19 // See dartbug.com/20188 |
| 20 String filename = 'test.dart'; | 20 String pathname = sourcePath('test.dart'); |
| 21 String pathname = normalizePath(filename); | |
| 22 String text = | 21 String text = |
| 23 r''' | 22 r''' |
| 24 var test = ''; | 23 var test = ''; |
| 25 main() { | 24 main() { |
| 26 test. | 25 test. |
| 27 } | 26 } |
| 28 '''; | 27 '''; |
| 29 writeFile(filename, text); | 28 writeFile(pathname, text); |
| 30 setAnalysisRoots(['']); | 29 standardAnalysisRoot(); |
| 31 | 30 |
| 32 return analysisFinished.then((_) { | 31 return analysisFinished.then((_) { |
| 33 return server.send(COMPLETION_GET_SUGGESTIONS, { | 32 return server.send(COMPLETION_GET_SUGGESTIONS, { |
| 34 'file': pathname, | 33 'file': pathname, |
| 35 'offset': text.indexOf('test.') + 'test.'.length | 34 'offset': text.indexOf('test.') + 'test.'.length |
| 36 }).then((result) { | 35 }).then((result) { |
| 37 // Since the feature doesn't work yet, just pause for a second to | 36 // Since the feature doesn't work yet, just pause for a second to |
| 38 // collect the output of the analysis server, and then stop the test. | 37 // collect the output of the analysis server, and then stop the test. |
| 39 // TODO(paulberry): finish writing the integration test once the feature | 38 // TODO(paulberry): finish writing the integration test once the feature |
| 40 // it more complete. | 39 // it more complete. |
| 41 return new Future.delayed(new Duration(seconds: 1), () { | 40 return new Future.delayed(new Duration(seconds: 1), () { |
| 42 fail('test not completed yet'); | 41 fail('test not completed yet'); |
| 43 }); | 42 }); |
| 44 }); | 43 }); |
| 45 }); | 44 }); |
| 46 } | 45 } |
| 47 | 46 |
| 48 test_placeholder() { | 47 test_placeholder() { |
| 49 // The unit test framework freaks out if there are no tests, so this is a | 48 // The unit test framework freaks out if there are no tests, so this is a |
| 50 // placeholder until we have a passing test. | 49 // placeholder until we have a passing test. |
| 51 // TODO(paulberry): remove this. | 50 // TODO(paulberry): remove this. |
| 52 } | 51 } |
| 53 } | 52 } |
| 54 | 53 |
| 55 main() { | 54 main() { |
| 56 runReflectiveTests(CompletionDomainIntegrationTest); | 55 runReflectiveTests(CompletionDomainIntegrationTest); |
| 57 } | 56 } |
| OLD | NEW |