Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f4fc2c87
Unverified
Commit
f4fc2c87
authored
Feb 22, 2022
by
Emmanuel Garcia
Committed by
GitHub
Feb 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that render object changed its visual appearance after texture is create (#98622)
parent
94f6fd6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
platform_view_test.dart
packages/flutter/test/rendering/platform_view_test.dart
+41
-1
No files found.
packages/flutter/test/rendering/platform_view_test.dart
View file @
f4fc2c87
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:ui'
as
ui
;
import
'package:fake_async/fake_async.dart'
;
...
...
@@ -14,7 +15,7 @@ import '../services/fake_platform_views.dart';
import
'rendering_tester.dart'
;
void
main
(
)
{
TestRenderingFlutterBinding
.
ensureInitialized
();
final
TestRenderingFlutterBinding
binding
=
TestRenderingFlutterBinding
.
ensureInitialized
();
group
(
'PlatformViewRenderBox'
,
()
{
late
FakePlatformViewController
fakePlatformViewController
;
...
...
@@ -149,6 +150,45 @@ void main() {
// Passes if no crashes.
});
test
(
'render object changed its visual appearance after texture is created'
,
()
{
FakeAsync
().
run
((
FakeAsync
async
)
{
final
AndroidViewController
viewController
=
PlatformViewsService
.
initAndroidView
(
id:
0
,
viewType:
'webview'
,
layoutDirection:
TextDirection
.
rtl
);
final
RenderAndroidView
renderBox
=
RenderAndroidView
(
viewController:
viewController
,
hitTestBehavior:
PlatformViewHitTestBehavior
.
opaque
,
gestureRecognizers:
<
Factory
<
OneSequenceGestureRecognizer
>>{},
);
final
Completer
<
void
>
viewCreation
=
Completer
<
void
>();
const
MethodChannel
channel
=
MethodChannel
(
'flutter/platform_views'
);
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
channel
,
(
MethodCall
methodCall
)
async
{
assert
(
methodCall
.
method
==
'create'
,
'Unexpected method call'
);
await
viewCreation
.
future
;
return
/*textureId=*/
0
;
});
layout
(
renderBox
);
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
renderBox
.
debugLayer
,
isNotNull
);
expect
(
renderBox
.
debugLayer
!.
hasChildren
,
isFalse
);
expect
(
viewController
.
isCreated
,
isFalse
);
expect
(
renderBox
.
debugNeedsPaint
,
isFalse
);
viewCreation
.
complete
();
async
.
flushMicrotasks
();
expect
(
viewController
.
isCreated
,
isTrue
);
expect
(
renderBox
.
debugNeedsPaint
,
isTrue
);
expect
(
renderBox
.
debugLayer
!.
hasChildren
,
isFalse
);
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
renderBox
.
debugLayer
!.
hasChildren
,
isTrue
);
expect
(
renderBox
.
debugLayer
!.
firstChild
,
isA
<
TextureLayer
>());
});
});
}
ui
.
PointerData
_pointerData
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment