Skip to content

Commit 89c39ed

Browse files
authored
[CP-stable] Migrate Safari tests to macOS 26 (flutter#195437)
### Issue Link: What is the link to the issue this cherry-pick is addressing? flutter#193833, flutter#193834 ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping of production apps (the app crashes on launch). This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick. CI test-only change to migrate tests to macOS 26. This is a partial cherry-pick of flutter#193681, only including the parts required for macOS 26. ### Changelog Description: Explain this cherry pick: * In one line that is accessible to most Flutter developers. * That describes the state prior to the fix. * That includes which platforms are impacted. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples. N/A - CI test-only change ### Workaround: Is there a workaround for this issue? Rerun test ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? Run in CI
1 parent 8a32ce2 commit 89c39ed

4 files changed

Lines changed: 17 additions & 5 deletions

File tree

‎engine/src/flutter/ci/builders/linux_web_engine_test.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"recipe": "engine_v2/tester_engine",
494494
"drone_dimensions": [
495495
"device_type=none",
496-
"os=Mac-15.7",
496+
"os=Mac-26.6",
497497
"cpu=arm64"
498498
],
499499
"gclient_variables": {

‎engine/src/flutter/lib/web_ui/dev/generate_builder_json.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class GenerateBuilderJsonCommand extends Command<bool> {
102102
packageLock,
103103
'Mac',
104104
BrowserName.safari,
105-
specificOS: 'Mac-15.7',
105+
specificOS: 'Mac-26.6',
106106
cpu: 'arm64',
107107
),
108108
];

‎engine/src/flutter/lib/web_ui/test/engine/text_editing_test.dart‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4289,9 +4289,12 @@ Future<void> testMain() async {
42894289

42904290
expect(input.style.color, contains('transparent'));
42914291
if (isSafari) {
4292-
// macOS 13 returns different values than macOS 12.
4292+
// macOS 13+ / 26 returns different values than macOS 12.
42934293
expect(input.style.background, anyOf(contains('transparent'), contains('none')));
4294-
expect(input.style.outline, anyOf(contains('none'), contains('currentcolor')));
4294+
expect(
4295+
input.style.outline,
4296+
anyOf(contains('none'), contains('currentcolor'), contains('medium')),
4297+
);
42954298
expect(input.style.border, anyOf(contains('none'), contains('medium')));
42964299
} else {
42974300
expect(input.style.background, contains('transparent'));

‎engine/src/flutter/lib/web_ui/test/engine/view_embedder/style_manager_test.dart‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ void doTests() {
2727
styleNonce: 'testing',
2828
cssSelectorPrefix: DomManager.flutterViewTagName,
2929
);
30-
final expected = isFirefox ? 'rgb(0, 0, 0) 0px' : 'rgb(0, 0, 0) none 0px';
30+
final Object expected = isFirefox
31+
? 'rgb(0, 0, 0) 0px'
32+
: anyOf(<String>[
33+
'rgb(0, 0, 0) none 0px',
34+
'0px none rgb(0, 0, 0)',
35+
// In WebKit, `:focus` does not match when the Safari window lacks
36+
// OS-level WindowServer focus (`!domDocument.hasFocus()`), returning
37+
// the initial unfocused outline width (`medium` = `3px`) with `none`.
38+
if (isSafari && !domDocument.hasFocus()) '3px none rgb(0, 0, 0)',
39+
]);
3140

3241
// Focus the element.
3342
flutterViewElement.focusWithoutScroll();

0 commit comments

Comments
 (0)