OLD | NEW |
(Empty) | |
| 1 // This API is exploratory. |
| 2 spawnDomIsolate(Window targetWindow, String entryPoint) { |
| 3 if (targetWindow is! DOMWindowImplementation && targetWindow is! DOMWindowCros
sFrameImplementation) { |
| 4 throw 'Bad window argument: $targetWindow'; |
| 5 } |
| 6 final result = new Completer<SendPort>(); |
| 7 final port = Utils.spawnDomIsolate(targetWindow, entryPoint); |
| 8 window.setTimeout(() { result.complete(port); }, 0); |
| 9 return result.future; |
| 10 } |
| 11 |
| 12 // layoutTestController implementation. |
| 13 // FIXME: provide a separate lib for layoutTestController. |
| 14 |
| 15 var _layoutTestController; |
| 16 |
| 17 LayoutTestController get layoutTestController() { |
| 18 if (_layoutTestController === null) |
| 19 _layoutTestController = new LayoutTestController._(NPObject.retrieve("layout
TestController")); |
| 20 return _layoutTestController; |
| 21 } |
| 22 |
| 23 class LayoutTestController { |
| 24 final NPObject _npObject; |
| 25 |
| 26 LayoutTestController._(this._npObject); |
| 27 |
| 28 dumpAsText() => _npObject.invoke('dumpAsText'); |
| 29 notifyDone() => _npObject.invoke('notifyDone'); |
| 30 setCanOpenWindows() => _npObject.invoke('setCanOpenWindows'); |
| 31 waitUntilDone() => _npObject.invoke('waitUntilDone'); |
| 32 } |
OLD | NEW |