OLD | NEW |
1 part of effects_tests; | 1 part of effects_tests; |
2 | 2 |
3 // TODO: support case where many children, but invalid child called to show | 3 // TODO: support case where many children, but invalid child called to show |
4 // need to specify that all of the original children will still be shown | 4 // need to specify that all of the original children will still be shown |
5 | 5 |
6 void registerSwapperTests() { | 6 void registerSwapperTests() { |
7 group('Swapper', () { | 7 group('Swapper', () { |
8 tearDown(_cleanUpPlayground); | 8 tearDown(_cleanUpPlayground); |
9 | 9 |
10 _swapperTest(1, [], 0, true, 0); | 10 _swapperTest(1, [], 0, true, 0); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 expect(actualResult, expectedResult); | 103 expect(actualResult, expectedResult); |
104 })) | 104 })) |
105 .then((_) => _getDisplayedIndicies(pg)) | 105 .then((_) => _getDisplayedIndicies(pg)) |
106 .then(expectAsync1((List<int> displayedIndicies) { | 106 .then(expectAsync1((List<int> displayedIndicies) { |
107 if(expectedDisplayed == null) { | 107 if(expectedDisplayed == null) { |
108 expect(displayedIndicies, isEmpty, reason: 'There are no items to di
splay'); | 108 expect(displayedIndicies, isEmpty, reason: 'There are no items to di
splay'); |
109 } else { | 109 } else { |
110 expect(displayedIndicies.length, 1, reason: 'there should only be on
e displayed item'); | 110 expect(displayedIndicies.length, 1, reason: 'there should only be on
e displayed item'); |
111 expect(displayedIndicies[0], expectedDisplayed); | 111 expect(displayedIndicies[0], expectedDisplayed); |
112 } | 112 } |
113 }), onError: (AsyncError error) { | 113 }), onError: (error) { |
114 registerException(error.error, error.stackTrace); | 114 registerException(error.error, error.stackTrace); |
115 }); | 115 }); |
116 } | 116 } |
117 }); | 117 }); |
118 } | 118 } |
119 | 119 |
120 /** | 120 /** |
121 * get the list of all children of [host] that are currently 'shown' | 121 * get the list of all children of [host] that are currently 'shown' |
122 * assume all animations on all children are finished | 122 * assume all animations on all children are finished |
123 */ | 123 */ |
(...skipping 12 matching lines...) Expand all Loading... |
136 } | 136 } |
137 | 137 |
138 void _addTestElementToPlayground(String text, bool hidden) { | 138 void _addTestElementToPlayground(String text, bool hidden) { |
139 final display = hidden ? 'none' : 'block'; | 139 final display = hidden ? 'none' : 'block'; |
140 _getPlayground().children.add( | 140 _getPlayground().children.add( |
141 new DivElement() | 141 new DivElement() |
142 ..text = text | 142 ..text = text |
143 ..style.cssText = 'background: pink; width: 100px; height: 100px; displa
y: $display;' | 143 ..style.cssText = 'background: pink; width: 100px; height: 100px; displa
y: $display;' |
144 ); | 144 ); |
145 } | 145 } |
OLD | NEW |