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 | 4 |
5 #library('view_tests'); | 5 #library('view_tests'); |
6 | 6 |
7 #import('dart:html'); | 7 #import('dart:html'); |
8 #import('../../../../ui_lib/base/base.dart'); | 8 #import('../../../../ui_lib/base/base.dart'); |
9 #import('../../../../ui_lib/view/view.dart'); | 9 #import('../../../../ui_lib/view/view.dart'); |
10 #import('../../../../../pkg/unittest/lib/unittest.dart'); | 10 #import('../../../../../pkg/unittest/unittest.dart'); |
11 #import('../../../../../pkg/unittest/lib/html_config.dart'); | 11 #import('../../../../../pkg/unittest/html_config.dart'); |
12 | 12 |
13 void main() { | 13 void main() { |
14 useHtmlConfiguration(); | 14 useHtmlConfiguration(); |
15 test('does not render immediately', () { | 15 test('does not render immediately', () { |
16 final view = new TestView(); | 16 final view = new TestView(); |
17 expect(view.isRendered, isFalse); | 17 expect(view.isRendered, isFalse); |
18 | 18 |
19 view.addToDocument(document.body); | 19 view.addToDocument(document.body); |
20 expect(view.isRendered, isTrue); | 20 expect(view.isRendered, isTrue); |
21 }); | 21 }); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 afterRenderFn = (node) {}; | 196 afterRenderFn = (node) {}; |
197 enterDocumentFn = () {}; | 197 enterDocumentFn = () {}; |
198 exitDocumentFn = () {}; | 198 exitDocumentFn = () {}; |
199 } | 199 } |
200 | 200 |
201 Element render() => renderFn(); | 201 Element render() => renderFn(); |
202 void afterRender(Element node) { afterRenderFn(node); } | 202 void afterRender(Element node) { afterRenderFn(node); } |
203 void enterDocument() { enterDocumentFn(); } | 203 void enterDocument() { enterDocumentFn(); } |
204 void exitDocument() { exitDocumentFn(); } | 204 void exitDocument() { exitDocumentFn(); } |
205 } | 205 } |
OLD | NEW |