OLD | NEW |
| 1 |
| 2 import "dart:sky.internals" as internals; |
| 3 |
| 4 import 'package:sky/mojo/shell.dart' as shell; |
| 5 import 'package:mojom/sky/test_harness.mojom.dart'; |
| 6 |
1 import "third_party/unittest/unittest.dart"; | 7 import "third_party/unittest/unittest.dart"; |
2 import "dart:sky.internals" as internals; | 8 |
| 9 void notifyTestComplete(String result) { |
| 10 TestHarnessProxy test_harness = new TestHarnessProxy.unbound(); |
| 11 shell.requestService("mojo:sky_viewer", test_harness); |
| 12 test_harness.ptr.onTestComplete(result, null); |
| 13 test_harness.close(); |
| 14 |
| 15 internals.notifyTestComplete("DONE"); |
| 16 } |
3 | 17 |
4 class _SkyConfig extends SimpleConfiguration { | 18 class _SkyConfig extends SimpleConfiguration { |
5 void onDone(bool success) { | 19 void onDone(bool success) { |
6 try { | 20 try { |
7 super.onDone(success); | 21 super.onDone(success); |
8 } catch (ex) { | 22 } catch (ex) { |
9 print(ex.toString()); | 23 print(ex.toString()); |
10 } | 24 } |
11 | 25 |
12 internals.notifyTestComplete("DONE"); | 26 notifyTestComplete("DONE"); |
13 } | 27 } |
14 } | 28 } |
15 | 29 |
16 final _singleton = new _SkyConfig(); | 30 final _singleton = new _SkyConfig(); |
17 | 31 |
18 void initUnit() { | 32 void initUnit() { |
19 unittestConfiguration = _singleton; | 33 unittestConfiguration = _singleton; |
20 } | 34 } |
OLD | NEW |