OLD | NEW |
1 part of dromaeo; | 1 part of dromaeo; |
2 | 2 |
3 typedef void Test(); | 3 typedef void Test(); |
4 typedef void Operation(); | 4 typedef void Operation(); |
5 typedef void Reporter(Map<String, Result> results); | 5 typedef void Reporter(Map<String, Result> results); |
6 | 6 |
7 class Suite { | 7 class Suite { |
8 /** | 8 /** |
9 * Ctor. | 9 * Ctor. |
10 * [:_window:] The window of the suite. | 10 * [:_window:] The window of the suite. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 'error': result.error, | 106 'error': result.error, |
107 'percent': (100.0 * _nRanTests / _nTests) | 107 'percent': (100.0 * _nRanTests / _nTests) |
108 }); | 108 }); |
109 } | 109 } |
110 | 110 |
111 _postMessage(String command, [var data = null]) { | 111 _postMessage(String command, [var data = null]) { |
112 final payload = { 'command': command }; | 112 final payload = { 'command': command }; |
113 if (data != null) { | 113 if (data != null) { |
114 payload['data'] = data; | 114 payload['data'] = data; |
115 } | 115 } |
116 _window.top.postMessage(JSON.encode(payload), '*'); | 116 _window.parent.postMessage(JSON.encode(payload), '*'); |
117 } | 117 } |
118 | 118 |
119 // Implementation. | 119 // Implementation. |
120 | 120 |
121 final Window _window; | 121 final Window _window; |
122 final String _name; | 122 final String _name; |
123 | 123 |
124 List<Operation> _operations; | 124 List<Operation> _operations; |
125 int _nTests; | 125 int _nTests; |
126 int _nRanTests; | 126 int _nRanTests; |
127 | 127 |
128 Suite _addOperation(Operation operation) { | 128 Suite _addOperation(Operation operation) { |
129 _operations.add(operation); | 129 _operations.add(operation); |
130 return this; | 130 return this; |
131 } | 131 } |
132 } | 132 } |
OLD | NEW |