[macOS] Fix test fixture identifier style (flutter/engine#33118)
Rename the C++ style can_composite_platform_views and native_callback functions to the Dart-style identifiers canCompositePlatformViews and nativeCallback in the macOS desktop test fixtures. Also corrects the helper method identifier from CreateSimplePicture to _createSimplePicture, thus making it library-private to help readers understand it's a local helper. Ref: [Flutter Style Guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#naming) Ref: [Effective Dart](https://dart.dev/guides/language/effective-dart/style#do-name-other-identifiers-using-lowercamelcase)
This commit is contained in:
@@ -357,7 +357,7 @@ TEST_F(FlutterEngineTest, ResetsAccessibilityBridgeWhenSetsNewViewController) {
|
||||
|
||||
TEST_F(FlutterEngineTest, NativeCallbacks) {
|
||||
FlutterEngine* engine = GetFlutterEngine();
|
||||
EXPECT_TRUE([engine runWithEntrypoint:@"native_callback"]);
|
||||
EXPECT_TRUE([engine runWithEntrypoint:@"nativeCallback"]);
|
||||
EXPECT_TRUE(engine.running);
|
||||
|
||||
fml::AutoResetWaitableEvent latch;
|
||||
@@ -384,7 +384,7 @@ TEST(FlutterEngine, DISABLED_Compositor) {
|
||||
viewController.flutterView.frame = CGRectMake(0, 0, 800, 600);
|
||||
[engine setViewController:viewController];
|
||||
|
||||
EXPECT_TRUE([engine runWithEntrypoint:@"can_composite_platform_views"]);
|
||||
EXPECT_TRUE([engine runWithEntrypoint:@"canCompositePlatformViews"]);
|
||||
|
||||
// Latch to ensure the entire layer tree has been generated and presented.
|
||||
fml::AutoResetWaitableEvent latch;
|
||||
|
||||
@@ -16,7 +16,22 @@ void canLogToStdout() {
|
||||
signalNativeTest();
|
||||
}
|
||||
|
||||
Picture CreateSimplePicture() {
|
||||
@pragma('vm:entry-point')
|
||||
void canCompositePlatformViews() {
|
||||
PlatformDispatcher.instance.onBeginFrame = (Duration duration) {
|
||||
SceneBuilder builder = SceneBuilder();
|
||||
builder.addPicture(Offset(1.0, 1.0), _createSimplePicture());
|
||||
builder.pushOffset(1.0, 2.0);
|
||||
builder.addPlatformView(42, width: 123.0, height: 456.0);
|
||||
builder.addPicture(Offset(1.0, 1.0), _createSimplePicture());
|
||||
builder.pop(); // offset
|
||||
PlatformDispatcher.instance.views.first.render(builder.build());
|
||||
};
|
||||
PlatformDispatcher.instance.scheduleFrame();
|
||||
}
|
||||
|
||||
/// Returns a [Picture] of a simple black square.
|
||||
Picture _createSimplePicture() {
|
||||
Paint blackPaint = Paint();
|
||||
PictureRecorder baseRecorder = PictureRecorder();
|
||||
Canvas canvas = Canvas(baseRecorder);
|
||||
@@ -25,20 +40,6 @@ Picture CreateSimplePicture() {
|
||||
}
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
void can_composite_platform_views() {
|
||||
PlatformDispatcher.instance.onBeginFrame = (Duration duration) {
|
||||
SceneBuilder builder = SceneBuilder();
|
||||
builder.addPicture(Offset(1.0, 1.0), CreateSimplePicture());
|
||||
builder.pushOffset(1.0, 2.0);
|
||||
builder.addPlatformView(42, width: 123.0, height: 456.0);
|
||||
builder.addPicture(Offset(1.0, 1.0), CreateSimplePicture());
|
||||
builder.pop(); // offset
|
||||
PlatformDispatcher.instance.views.first.render(builder.build());
|
||||
};
|
||||
PlatformDispatcher.instance.scheduleFrame();
|
||||
}
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
void native_callback() {
|
||||
void nativeCallback() {
|
||||
signalNativeTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user