This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Remove context assertion from Android platform views using Virtual Display #35997
Merged
auto-submit
merged 5 commits into
flutter:main
from
stuartmorgan-g:android-platform-view-vd-remove-assertion
Sep 9, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a8662e9
Add a test reproducing the problem
stuartmorgan-g bc6fbd4
Remove the assertion
stuartmorgan-g eba2677
Add issue link
stuartmorgan-g 7e66abd
Merge branch 'flutter:main' into android-platform-view-vd-remove-asse…
stuartmorgan f2ab551
Merge branch 'flutter:main' into android-platform-view-vd-remove-asse…
stuartmorgan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...androidTest/java/dev/flutter/scenariosui/PlatformViewWithSurfaceViewBadContextUiTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| package dev.flutter.scenariosui; | ||
|
|
||
| import android.content.Intent; | ||
| import androidx.annotation.NonNull; | ||
| import androidx.test.filters.LargeTest; | ||
| import androidx.test.rule.ActivityTestRule; | ||
| import androidx.test.runner.AndroidJUnit4; | ||
| import dev.flutter.scenarios.PlatformViewsActivity; | ||
| import org.junit.Before; | ||
| import org.junit.Rule; | ||
| import org.junit.Test; | ||
| import org.junit.runner.RunWith; | ||
|
|
||
| @RunWith(AndroidJUnit4.class) | ||
| @LargeTest | ||
| public class PlatformViewWithSurfaceViewBadContextUiTest { | ||
| Intent intent; | ||
|
|
||
| @Rule @NonNull | ||
| public ActivityTestRule<PlatformViewsActivity> activityRule = | ||
| new ActivityTestRule<>( | ||
| PlatformViewsActivity.class, /*initialTouchMode=*/ false, /*launchActivity=*/ false); | ||
|
|
||
| private static String goldName(String suffix) { | ||
| return "PlatformViewWithSurfaceViewBadContextUiTest_" + suffix; | ||
| } | ||
|
|
||
| @Before | ||
| public void setUp() { | ||
| intent = new Intent(Intent.ACTION_MAIN); | ||
| // Render a texture. | ||
| intent.putExtra("use_android_view", false); | ||
| intent.putExtra("view_type", PlatformViewsActivity.SURFACE_VIEW_BAD_CONTEXT_PV); | ||
| } | ||
|
|
||
| @Test | ||
| public void testPlatformView() throws Exception { | ||
| intent.putExtra("scenario_name", "platform_view"); | ||
| ScreenshotUtil.capture(activityRule.launchActivity(intent), goldName("testPlatformView")); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I lost at least an hour to figuring out why my new factory wasn't working at all 😐 I didn't want to yak-shave right now since this is an important fix, and one that I want to scope-limit so that we can cherry-pick it to stable, so I just left comments so that at least the problem will be obvious to the next person.