@@ -110,41 +110,23 @@ void doTests() {
110
110
});
111
111
112
112
test ('funnels resize events on sizeSource' , () async {
113
- final Future <Object ?> event = provider.onResize.first;
114
- final Future <List <Object ?>> events = provider.onResize.take (3 ).toList ();
115
-
116
- // The resize observer fires asynchronously, so we wait a little between
117
- // resizes, so the observer has time to fire events separately.
118
- await Future <void >.delayed (const Duration (milliseconds: 100 ), () {
119
- sizeSource
120
- ..style.width = '100px'
121
- ..style.height = '100px' ;
122
- });
113
+ sizeSource
114
+ ..style.width = '100px'
115
+ ..style.height = '100px' ;
123
116
124
- await Future <void >.delayed (const Duration (milliseconds: 100 ), () {
125
- sizeSource
126
- ..style.width = '200px'
127
- ..style.height = '200px' ;
128
- });
117
+ expect (await provider.onResize.first, const ui.Size (100 , 100 ));
129
118
130
- await Future <void >.delayed (const Duration (milliseconds: 100 ), () {
131
- sizeSource
132
- ..style.width = '300px'
133
- ..style.height = '300px' ;
134
- });
119
+ sizeSource
120
+ ..style.width = '200px'
121
+ ..style.height = '200px' ;
135
122
136
- // Let the DOM settle so the observer reports the last 300x300 mutation...
137
- await Future <void >.delayed (const Duration (milliseconds: 100 ));
123
+ expect (await provider.onResize.first, const ui.Size (200 , 200 ));
124
+
125
+ sizeSource
126
+ ..style.width = '300px'
127
+ ..style.height = '300px' ;
138
128
139
- expect (event, completion (const ui.Size (100 , 100 )));
140
- expect (events, completes);
141
- expect (
142
- events,
143
- completion (const < ui.Size > [
144
- ui.Size (100 , 100 ),
145
- ui.Size (200 , 200 ),
146
- ui.Size (300 , 300 ),
147
- ]));
129
+ expect (await provider.onResize.first, const ui.Size (300 , 300 ));
148
130
});
149
131
150
132
test ('closed by onHotRestart' , () async {
0 commit comments