Update rendering smoke tests to assert a frame has been scheduled (#82963)
This commit is contained in:
@@ -21,5 +21,5 @@ RenderBox buildSectorExample() {
|
||||
}
|
||||
|
||||
void main() {
|
||||
RenderingFlutterBinding(root: buildSectorExample());
|
||||
RenderingFlutterBinding(root: buildSectorExample()).scheduleFrame();
|
||||
}
|
||||
|
||||
@@ -86,5 +86,5 @@ void main() {
|
||||
child: RenderPadding(child: table, padding: const EdgeInsets.symmetric(vertical: 50.0)),
|
||||
);
|
||||
|
||||
RenderingFlutterBinding(root: root);
|
||||
RenderingFlutterBinding(root: root).scheduleFrame();
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ void main() {
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
),
|
||||
);
|
||||
).scheduleFrame();
|
||||
}
|
||||
|
||||
@@ -132,5 +132,5 @@ void main() {
|
||||
..left = 20.0;
|
||||
|
||||
// Finally, we attach the render tree we've built to the screen.
|
||||
RenderingFlutterBinding(root: stack);
|
||||
RenderingFlutterBinding(root: stack).scheduleFrame();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
// ignore: deprecated_member_use
|
||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
@@ -12,5 +13,6 @@ void main() {
|
||||
test('layers smoketest for rendering/custom_coordinate_systems.dart', () {
|
||||
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
|
||||
demo.main();
|
||||
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
// ignore: deprecated_member_use
|
||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
@@ -12,5 +13,6 @@ void main() {
|
||||
test('layers smoketest for rendering/flex_layout.dart', () {
|
||||
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
|
||||
demo.main();
|
||||
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
// ignore: deprecated_member_use
|
||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
@@ -12,5 +13,6 @@ void main() {
|
||||
test('layers smoketest for rendering/hello_world.dart', () {
|
||||
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
|
||||
demo.main();
|
||||
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
// ignore: deprecated_member_use
|
||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
@@ -12,5 +13,6 @@ void main() {
|
||||
test('layers smoketest for rendering/spinning_square.dart', () {
|
||||
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
|
||||
demo.main();
|
||||
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
// ignore: deprecated_member_use
|
||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
@@ -12,5 +13,6 @@ void main() {
|
||||
test('layers smoketest for rendering/touch_input.dart', () {
|
||||
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
|
||||
demo.main();
|
||||
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -534,6 +534,9 @@ class RenderingFlutterBinding extends BindingBase with GestureBinding, Scheduler
|
||||
///
|
||||
/// The `root` render box is attached directly to the [renderView] and is
|
||||
/// given constraints that require it to fill the window.
|
||||
///
|
||||
/// This binding does not automatically schedule any frames. Callers are
|
||||
/// responsible for deciding when to first call [scheduleFrame].
|
||||
RenderingFlutterBinding({ RenderBox? root }) {
|
||||
assert(renderView != null);
|
||||
renderView.child = root;
|
||||
|
||||
Reference in New Issue
Block a user