Visitar URL original
shell: Rename first-frame tests AddFirstFrameCallback* (#193418) · phamminhphuc/flutter@fab9915 · GitHub
Skip to content

Commit fab9915

Browse files
authored
shell: Rename first-frame tests AddFirstFrameCallback* (flutter#193418)
In flutter#191841, we replaced `Shell::WaitForFirstFrame` with `Shell::AddFirstFrameCallback` but didn't update the test names to match the new API. In particular, `WaitForFirstFrameTimeout` no longer tested that any caller-visible timeout fired, since the new API manages the timeout internally. The test now just verifies the first frame callback doesn't fire when no frame has rendered. Just naming changes, no semantic changes. Issue: b/521830222 ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [X] I updated/added relevant in-code documentation (doc comments with `///`). - [X] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 3475a9e commit fab9915

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎engine/src/flutter/shell/common/shell_unittests.cc‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ TEST_F(ShellTest, ReportTimingsIsCalledImmediatelyAfterTheFirstFrame) {
16651665
ASSERT_EQ(timestamps.size(), FrameTiming::kCount);
16661666
}
16671667

1668-
TEST_F(ShellTest, WaitForFirstFrame) {
1668+
TEST_F(ShellTest, AddFirstFrameCallbackFiresAfterFrame) {
16691669
auto settings = CreateSettingsForFixture();
16701670
std::unique_ptr<Shell> shell = CreateShell(settings);
16711671

@@ -1685,7 +1685,7 @@ TEST_F(ShellTest, WaitForFirstFrame) {
16851685
DestroyShell(std::move(shell));
16861686
}
16871687

1688-
TEST_F(ShellTest, WaitForFirstFrameZeroSizeFrame) {
1688+
TEST_F(ShellTest, AddFirstFrameCallbackDeferredIfZeroSizeFrame) {
16891689
auto settings = CreateSettingsForFixture();
16901690
std::unique_ptr<Shell> shell = CreateShell(settings);
16911691

@@ -1706,7 +1706,7 @@ TEST_F(ShellTest, WaitForFirstFrameZeroSizeFrame) {
17061706
DestroyShell(std::move(shell));
17071707
}
17081708

1709-
TEST_F(ShellTest, WaitForFirstFrameTimeout) {
1709+
TEST_F(ShellTest, AddFirstFrameCallbackDeferredIfNoFrame) {
17101710
auto settings = CreateSettingsForFixture();
17111711
std::unique_ptr<Shell> shell = CreateShell(settings);
17121712

@@ -1726,7 +1726,7 @@ TEST_F(ShellTest, WaitForFirstFrameTimeout) {
17261726
DestroyShell(std::move(shell));
17271727
}
17281728

1729-
TEST_F(ShellTest, WaitForFirstFrameMultiple) {
1729+
TEST_F(ShellTest, AddFirstFrameCallbackMultiple) {
17301730
auto settings = CreateSettingsForFixture();
17311731
std::unique_ptr<Shell> shell = CreateShell(settings);
17321732

@@ -1752,9 +1752,9 @@ TEST_F(ShellTest, WaitForFirstFrameMultiple) {
17521752
DestroyShell(std::move(shell));
17531753
}
17541754

1755-
/// Makes sure that WaitForFirstFrame works if we rendered a frame with the
1755+
/// Makes sure that AddFirstFrameCallback fires if we rendered a frame with the
17561756
/// single-thread setup.
1757-
TEST_F(ShellTest, WaitForFirstFrameInlined) {
1757+
TEST_F(ShellTest, AddFirstFrameCallbackInlined) {
17581758
Settings settings = CreateSettingsForFixture();
17591759
auto task_runner = CreateNewThread();
17601760
TaskRunners task_runners("test", task_runner, task_runner, task_runner,

0 commit comments

Comments
 (0)