Unverified Commit 669a8150 authored by Dan Field's avatar Dan Field Committed by GitHub

Update rendering smoke tests to assert a frame has been scheduled (#82963)

parent 78a96b09
...@@ -21,5 +21,5 @@ RenderBox buildSectorExample() { ...@@ -21,5 +21,5 @@ RenderBox buildSectorExample() {
} }
void main() { void main() {
RenderingFlutterBinding(root: buildSectorExample()); RenderingFlutterBinding(root: buildSectorExample()).scheduleFrame();
} }
...@@ -86,5 +86,5 @@ void main() { ...@@ -86,5 +86,5 @@ void main() {
child: RenderPadding(child: table, padding: const EdgeInsets.symmetric(vertical: 50.0)), child: RenderPadding(child: table, padding: const EdgeInsets.symmetric(vertical: 50.0)),
); );
RenderingFlutterBinding(root: root); RenderingFlutterBinding(root: root).scheduleFrame();
} }
...@@ -25,5 +25,5 @@ void main() { ...@@ -25,5 +25,5 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
), ),
), ),
); ).scheduleFrame();
} }
...@@ -132,5 +132,5 @@ void main() { ...@@ -132,5 +132,5 @@ void main() {
..left = 20.0; ..left = 20.0;
// Finally, we attach the render tree we've built to the screen. // Finally, we attach the render tree we've built to the screen.
RenderingFlutterBinding(root: stack); RenderingFlutterBinding(root: stack).scheduleFrame();
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
// ignore: deprecated_member_use // ignore: deprecated_member_use
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
...@@ -12,5 +13,6 @@ void main() { ...@@ -12,5 +13,6 @@ void main() {
test('layers smoketest for rendering/custom_coordinate_systems.dart', () { test('layers smoketest for rendering/custom_coordinate_systems.dart', () {
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; }; FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
demo.main(); demo.main();
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
}); });
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
// ignore: deprecated_member_use // ignore: deprecated_member_use
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
...@@ -12,5 +13,6 @@ void main() { ...@@ -12,5 +13,6 @@ void main() {
test('layers smoketest for rendering/flex_layout.dart', () { test('layers smoketest for rendering/flex_layout.dart', () {
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; }; FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
demo.main(); demo.main();
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
}); });
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
// ignore: deprecated_member_use // ignore: deprecated_member_use
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
...@@ -12,5 +13,6 @@ void main() { ...@@ -12,5 +13,6 @@ void main() {
test('layers smoketest for rendering/hello_world.dart', () { test('layers smoketest for rendering/hello_world.dart', () {
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; }; FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
demo.main(); demo.main();
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
}); });
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
// ignore: deprecated_member_use // ignore: deprecated_member_use
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
...@@ -12,5 +13,6 @@ void main() { ...@@ -12,5 +13,6 @@ void main() {
test('layers smoketest for rendering/spinning_square.dart', () { test('layers smoketest for rendering/spinning_square.dart', () {
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; }; FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
demo.main(); demo.main();
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
}); });
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
// ignore: deprecated_member_use // ignore: deprecated_member_use
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
...@@ -12,5 +13,6 @@ void main() { ...@@ -12,5 +13,6 @@ void main() {
test('layers smoketest for rendering/touch_input.dart', () { test('layers smoketest for rendering/touch_input.dart', () {
FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; }; FlutterError.onError = (FlutterErrorDetails details) { throw details.exception; };
demo.main(); demo.main();
expect(SchedulerBinding.instance!.hasScheduledFrame, true);
}); });
} }
...@@ -534,6 +534,9 @@ class RenderingFlutterBinding extends BindingBase with GestureBinding, Scheduler ...@@ -534,6 +534,9 @@ class RenderingFlutterBinding extends BindingBase with GestureBinding, Scheduler
/// ///
/// The `root` render box is attached directly to the [renderView] and is /// The `root` render box is attached directly to the [renderView] and is
/// given constraints that require it to fill the window. /// 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 }) { RenderingFlutterBinding({ RenderBox? root }) {
assert(renderView != null); assert(renderView != null);
renderView.child = root; renderView.child = root;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment