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('Smoketests_main'); | 4 #library('Smoketests_main'); |
5 | 5 |
6 #import('benchmarklib.dart'); | 6 #import('benchmarklib.dart'); |
7 #import('dart:html'); | 7 #import('dart:html'); |
8 #import('../../../../../lib/unittest/unittest_html.dart'); | 8 #import('../../../../../lib/unittest/unittest.dart'); |
| 9 #import('../../../../../lib/unittest/html_config.dart'); |
9 | 10 |
10 void main() { | 11 void main() { |
| 12 useHtmlConfiguration(); |
| 13 |
11 asyncTest('performanceTesting', 1, () { | 14 asyncTest('performanceTesting', 1, () { |
12 window.setTimeout(BENCHMARK_SUITE.runBenchmarks, 0); | 15 window.setTimeout(BENCHMARK_SUITE.runBenchmarks, 0); |
13 window.setTimeout(testForCompletion, 0); | 16 window.setTimeout(testForCompletion, 0); |
14 }); | 17 }); |
15 } | 18 } |
16 | 19 |
17 testForCompletion() { | 20 testForCompletion() { |
18 Element element = document.query('#testResultScore'); | 21 Element element = document.query('#testResultScore'); |
19 RegExp re = new RegExp('Score: [0-9]+'); | 22 RegExp re = new RegExp('Score: [0-9]+'); |
20 print(element.text); | 23 print(element.text); |
21 Expect.isTrue(re.hasMatch(element.text)); | 24 Expect.isTrue(re.hasMatch(element.text)); |
22 callbackDone(); | 25 callbackDone(); |
23 } | 26 } |
OLD | NEW |