| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #library('benchmark_smoke_test'); | 4 #library('benchmark_smoke_test'); |
| 5 | 5 |
| 6 // Tests that benchmark classes used in perf testing are not broken. | 6 // Tests that benchmark classes used in perf testing are not broken. |
| 7 #import('benchmark_lib.dart'); | 7 #import('benchmark_lib.dart'); |
| 8 #import('dart:html'); | 8 #import('dart:html'); |
| 9 #import('../../pkg/unittest/unittest.dart'); | 9 #import('../../pkg/unittest/lib/unittest.dart'); |
| 10 #import('../../pkg/unittest/html_config.dart'); | 10 #import('../../pkg/unittest/lib/html_config.dart'); |
| 11 | 11 |
| 12 void main() { | 12 void main() { |
| 13 useHtmlConfiguration(); | 13 useHtmlConfiguration(); |
| 14 | 14 |
| 15 test('performanceTesting', () { | 15 test('performanceTesting', () { |
| 16 window.setTimeout(BENCHMARK_SUITE.runBenchmarks, 0); | 16 window.setTimeout(BENCHMARK_SUITE.runBenchmarks, 0); |
| 17 window.setTimeout(expectAsync0(testForCompletion), 0); | 17 window.setTimeout(expectAsync0(testForCompletion), 0); |
| 18 }); | 18 }); |
| 19 } | 19 } |
| 20 | 20 |
| 21 testForCompletion() { | 21 testForCompletion() { |
| 22 Element element = document.query('#testResultScore'); | 22 Element element = document.query('#testResultScore'); |
| 23 RegExp re = new RegExp('Score: [0-9]+'); | 23 RegExp re = new RegExp('Score: [0-9]+'); |
| 24 print(element.text); | 24 print(element.text); |
| 25 Expect.isTrue(re.hasMatch(element.text)); | 25 Expect.isTrue(re.hasMatch(element.text)); |
| 26 } | 26 } |
| OLD | NEW |