mirror of
https://github.com/flutter/packages.git
synced 2025-07-01 23:51:55 +08:00
Make the widgets binding reusable. (#3479)
Previously the widgets layer only provided a concrete binding, which makes it awkward to extend it compared to other bindings. This moves widgets to the same style as the other layers. In a subsequent patch I'll use this to make the tests layer saner.
This commit is contained in:
@ -100,9 +100,9 @@ void main() {
|
|||||||
tester.pumpWidget(new Markdown(data: "Data1"));
|
tester.pumpWidget(new Markdown(data: "Data1"));
|
||||||
_expectTextStrings(tester.widgets, <String>["Data1"]);
|
_expectTextStrings(tester.widgets, <String>["Data1"]);
|
||||||
|
|
||||||
String stateBefore = WidgetFlutterBinding.instance.renderViewElement.toStringDeep();
|
String stateBefore = Widgeteer.instance.renderViewElement.toStringDeep();
|
||||||
tester.pumpWidget(new Markdown(data: "Data1"));
|
tester.pumpWidget(new Markdown(data: "Data1"));
|
||||||
String stateAfter = WidgetFlutterBinding.instance.renderViewElement.toStringDeep();
|
String stateAfter = Widgeteer.instance.renderViewElement.toStringDeep();
|
||||||
expect(stateBefore, equals(stateAfter));
|
expect(stateBefore, equals(stateAfter));
|
||||||
|
|
||||||
tester.pumpWidget(new Markdown(data: "Data2"));
|
tester.pumpWidget(new Markdown(data: "Data2"));
|
||||||
@ -119,9 +119,9 @@ void main() {
|
|||||||
|
|
||||||
tester.pumpWidget(new Markdown(data: "Test", markdownStyle: style1));
|
tester.pumpWidget(new Markdown(data: "Test", markdownStyle: style1));
|
||||||
|
|
||||||
String stateBefore = WidgetFlutterBinding.instance.renderViewElement.toStringDeep();
|
String stateBefore = Widgeteer.instance.renderViewElement.toStringDeep();
|
||||||
tester.pumpWidget(new Markdown(data: "Test", markdownStyle: style2));
|
tester.pumpWidget(new Markdown(data: "Test", markdownStyle: style2));
|
||||||
String stateAfter = WidgetFlutterBinding.instance.renderViewElement.toStringDeep();
|
String stateAfter = Widgeteer.instance.renderViewElement.toStringDeep();
|
||||||
expect(stateBefore, isNot(stateAfter));
|
expect(stateBefore, isNot(stateAfter));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user