Unverified Commit 7aa17231 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Revert "Reland "Update PopupMenuButton to match Material Design spec"" (#75338)

parent f69f06e5
...@@ -409,14 +409,8 @@ void main() { ...@@ -409,14 +409,8 @@ void main() {
}); });
test('Popup Menu has correct Android semantics', () async { test('Popup Menu has correct Android semantics', () async {
final SerializableFinder button = find.descendant(
of: find.byValueKey(popupButtonKeyValue),
matching: find.byType('Semantics'),
firstMatchOnly: true,
);
expect( expect(
await getSemantics(button), await getSemantics(find.byValueKey(popupButtonKeyValue)),
hasAndroidSemantics( hasAndroidSemantics(
className: AndroidClassName.button, className: AndroidClassName.button,
isChecked: false, isChecked: false,
...@@ -451,8 +445,7 @@ void main() { ...@@ -451,8 +445,7 @@ void main() {
AndroidSemanticsAction.click, AndroidSemanticsAction.click,
], ],
), ),
reason: "Popup $item doesn't have the right semantics", reason: "Popup $item doesn't have the right semantics");
);
} }
await driver.tap(find.byValueKey('$popupKeyValue.${popupItems.first}')); await driver.tap(find.byValueKey('$popupKeyValue.${popupItems.first}'));
......
...@@ -38,7 +38,6 @@ void main() { ...@@ -38,7 +38,6 @@ void main() {
key: targetKey, key: targetKey,
builder: (BuildContext context) { builder: (BuildContext context) {
return PopupMenuButton<int>( return PopupMenuButton<int>(
placement: PopupMenuPlacement.belowButton,
onSelected: (int value) { onSelected: (int value) {
Navigator.pushNamed(context, '/next'); Navigator.pushNamed(context, '/next');
}, },
...@@ -79,20 +78,20 @@ void main() { ...@@ -79,20 +78,20 @@ void main() {
Offset bottomLeft = tester.getBottomLeft(find.text('hello, world')); Offset bottomLeft = tester.getBottomLeft(find.text('hello, world'));
Offset bottomRight = tester.getBottomRight(find.text('hello, world')); Offset bottomRight = tester.getBottomRight(find.text('hello, world'));
expect(topLeft, const Offset(392.0, 347.5)); expect(topLeft, const Offset(392.0, 299.5));
expect(topRight, const Offset(596.0, 347.5)); expect(topRight, const Offset(596.0, 299.5));
expect(bottomLeft, const Offset(392.0, 364.5)); expect(bottomLeft, const Offset(392.0, 316.5));
expect(bottomRight, const Offset(596.0, 364.5)); expect(bottomRight, const Offset(596.0, 316.5));
topLeft = tester.getTopLeft(find.text('你好,世界')); topLeft = tester.getTopLeft(find.text('你好,世界'));
topRight = tester.getTopRight(find.text('你好,世界')); topRight = tester.getTopRight(find.text('你好,世界'));
bottomLeft = tester.getBottomLeft(find.text('你好,世界')); bottomLeft = tester.getBottomLeft(find.text('你好,世界'));
bottomRight = tester.getBottomRight(find.text('你好,世界')); bottomRight = tester.getBottomRight(find.text('你好,世界'));
expect(topLeft, const Offset(392.0, 395.5)); expect(topLeft, const Offset(392.0, 347.5));
expect(topRight, const Offset(477.0, 395.5)); expect(topRight, const Offset(477.0, 347.5));
expect(bottomLeft, const Offset(392.0, 412.5)); expect(bottomLeft, const Offset(392.0, 364.5));
expect(bottomRight, const Offset(477.0, 412.5)); expect(bottomRight, const Offset(477.0, 364.5));
}); });
testWidgets('Text baseline with EN locale', (WidgetTester tester) async { testWidgets('Text baseline with EN locale', (WidgetTester tester) async {
...@@ -125,7 +124,6 @@ void main() { ...@@ -125,7 +124,6 @@ void main() {
key: targetKey, key: targetKey,
builder: (BuildContext context) { builder: (BuildContext context) {
return PopupMenuButton<int>( return PopupMenuButton<int>(
placement: PopupMenuPlacement.belowButton,
onSelected: (int value) { onSelected: (int value) {
Navigator.pushNamed(context, '/next'); Navigator.pushNamed(context, '/next');
}, },
...@@ -166,19 +164,19 @@ void main() { ...@@ -166,19 +164,19 @@ void main() {
Offset bottomLeft = tester.getBottomLeft(find.text('hello, world')); Offset bottomLeft = tester.getBottomLeft(find.text('hello, world'));
Offset bottomRight = tester.getBottomRight(find.text('hello, world')); Offset bottomRight = tester.getBottomRight(find.text('hello, world'));
expect(topLeft, const Offset(392.0, 348.0)); expect(topLeft, const Offset(392.0, 300.0));
expect(topRight, const Offset(584.0, 348.0)); expect(topRight, const Offset(584.0, 300.0));
expect(bottomLeft, const Offset(392.0, 364)); expect(bottomLeft, const Offset(392.0, 316));
expect(bottomRight, const Offset(584.0, 364)); expect(bottomRight, const Offset(584.0, 316));
topLeft = tester.getTopLeft(find.text('你好,世界')); topLeft = tester.getTopLeft(find.text('你好,世界'));
topRight = tester.getTopRight(find.text('你好,世界')); topRight = tester.getTopRight(find.text('你好,世界'));
bottomLeft = tester.getBottomLeft(find.text('你好,世界')); bottomLeft = tester.getBottomLeft(find.text('你好,世界'));
bottomRight = tester.getBottomRight(find.text('你好,世界')); bottomRight = tester.getBottomRight(find.text('你好,世界'));
expect(topLeft, const Offset(392.0, 396.0)); expect(topLeft, const Offset(392.0, 348.0));
expect(topRight, const Offset(472.0, 396.0)); expect(topRight, const Offset(472.0, 348.0));
expect(bottomLeft, const Offset(392.0, 412.0)); expect(bottomLeft, const Offset(392.0, 364.0));
expect(bottomRight, const Offset(472.0, 412.0)); expect(bottomRight, const Offset(472.0, 364.0));
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment