Commit 7defaca9 authored by Amir Hardon's avatar Amir Hardon Committed by amirh

fix formatting for test/widgets/platform_view_test.dart

parent ccaa0636
...@@ -18,20 +18,20 @@ void main() { ...@@ -18,20 +18,20 @@ void main() {
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView(viewType: 'webview'), child: AndroidView(viewType: 'webview'),
) ),
) ),
); );
expect( expect(
viewsController.views, viewsController.views,
unorderedEquals(<FakePlatformView>[ unorderedEquals(<FakePlatformView>[
new FakePlatformView(currentViewId + 1, 'webview', const Size(200.0, 100.0)) new FakePlatformView(currentViewId + 1, 'webview', const Size(200.0, 100.0))
]) ]),
); );
}); });
...@@ -40,30 +40,30 @@ void main() { ...@@ -40,30 +40,30 @@ void main() {
final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android); final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android);
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView(viewType: 'webview'), child: AndroidView(viewType: 'webview'),
) ),
) ),
); );
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
child: SizedBox( child: SizedBox(
width: 400.0, width: 400.0,
height: 200.0, height: 200.0,
child: AndroidView(viewType: 'webview'), child: AndroidView(viewType: 'webview'),
) ),
) ),
); );
expect( expect(
viewsController.views, viewsController.views,
unorderedEquals(<FakePlatformView>[ unorderedEquals(<FakePlatformView>[
new FakePlatformView(currentViewId + 1, 'webview', const Size(400.0, 200.0)) new FakePlatformView(currentViewId + 1, 'webview', const Size(400.0, 200.0))
]) ]),
); );
}); });
...@@ -73,30 +73,30 @@ void main() { ...@@ -73,30 +73,30 @@ void main() {
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
viewsController.registerViewType('maps'); viewsController.registerViewType('maps');
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView(viewType: 'webview'), child: AndroidView(viewType: 'webview'),
) ),
) ),
); );
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView(viewType: 'maps'), child: AndroidView(viewType: 'maps'),
) ),
) ),
); );
expect( expect(
viewsController.views, viewsController.views,
unorderedEquals(<FakePlatformView>[ unorderedEquals(<FakePlatformView>[
new FakePlatformView(currentViewId + 2, 'maps', const Size(200.0, 100.0)) new FakePlatformView(currentViewId + 2, 'maps', const Size(200.0, 100.0))
]) ]),
); );
}); });
...@@ -104,22 +104,22 @@ void main() { ...@@ -104,22 +104,22 @@ void main() {
final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android); final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android);
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView(viewType: 'webview'), child: AndroidView(viewType: 'webview'),
) ),
) ),
); );
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
) ),
) ),
); );
expect( expect(
...@@ -134,13 +134,13 @@ void main() { ...@@ -134,13 +134,13 @@ void main() {
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
final GlobalKey key = new GlobalKey(); final GlobalKey key = new GlobalKey();
await tester.pumpWidget( await tester.pumpWidget(
new Center( new Center(
child: new SizedBox( child: new SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: new AndroidView(viewType: 'webview', key: key), child: new AndroidView(viewType: 'webview', key: key),
) ),
) ),
); );
await tester.pumpWidget( await tester.pumpWidget(
...@@ -156,10 +156,10 @@ void main() { ...@@ -156,10 +156,10 @@ void main() {
); );
expect( expect(
viewsController.views, viewsController.views,
unorderedEquals(<FakePlatformView>[ unorderedEquals(<FakePlatformView>[
new FakePlatformView(currentViewId + 1, 'webview', const Size(200.0, 100.0)) new FakePlatformView(currentViewId + 1, 'webview', const Size(200.0, 100.0))
]) ]),
); );
}); });
...@@ -168,14 +168,14 @@ void main() { ...@@ -168,14 +168,14 @@ void main() {
final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android); final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android);
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
await tester.pumpWidget( await tester.pumpWidget(
const Align( const Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView(viewType: 'webview'), child: AndroidView(viewType: 'webview'),
) ),
) ),
); );
final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0));
...@@ -186,7 +186,7 @@ void main() { ...@@ -186,7 +186,7 @@ void main() {
orderedEquals(<FakeMotionEvent> [ orderedEquals(<FakeMotionEvent> [
const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(50.0, 50.0)]), const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(50.0, 50.0)]),
const FakeMotionEvent(AndroidViewController.kActionUp, <int> [0], <Offset> [Offset(50.0, 50.0)]), const FakeMotionEvent(AndroidViewController.kActionUp, <int> [0], <Offset> [Offset(50.0, 50.0)]),
]) ]),
); );
}); });
...@@ -206,14 +206,14 @@ void main() { ...@@ -206,14 +206,14 @@ void main() {
onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; },
), ),
const Positioned( const Positioned(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView( child: AndroidView(
viewType: 'webview', viewType: 'webview',
hitTestBehavior: PlatformViewHitTestBehavior.transparent, hitTestBehavior: PlatformViewHitTestBehavior.transparent,
), ),
) ),
), ),
], ],
), ),
...@@ -223,12 +223,12 @@ void main() { ...@@ -223,12 +223,12 @@ void main() {
await tester.startGesture(const Offset(50.0, 50.0)); await tester.startGesture(const Offset(50.0, 50.0));
expect( expect(
viewsController.motionEvents[currentViewId + 1], viewsController.motionEvents[currentViewId + 1],
isNull, isNull,
); );
expect( expect(
numPointerDownsOnParent, numPointerDownsOnParent,
1 1
); );
}); });
...@@ -248,14 +248,14 @@ void main() { ...@@ -248,14 +248,14 @@ void main() {
onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; },
), ),
const Positioned( const Positioned(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView( child: AndroidView(
viewType: 'webview', viewType: 'webview',
hitTestBehavior: PlatformViewHitTestBehavior.translucent, hitTestBehavior: PlatformViewHitTestBehavior.translucent,
), ),
) ),
), ),
], ],
), ),
...@@ -266,9 +266,9 @@ void main() { ...@@ -266,9 +266,9 @@ void main() {
expect( expect(
viewsController.motionEvents[currentViewId + 1], viewsController.motionEvents[currentViewId + 1],
orderedEquals(<FakeMotionEvent> [ orderedEquals(<FakeMotionEvent> [
const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(50.0, 50.0)]), const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(50.0, 50.0)]),
]) ]),
); );
expect( expect(
numPointerDownsOnParent, numPointerDownsOnParent,
...@@ -292,14 +292,14 @@ void main() { ...@@ -292,14 +292,14 @@ void main() {
onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; },
), ),
const Positioned( const Positioned(
child: SizedBox( child: SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView( child: AndroidView(
viewType: 'webview', viewType: 'webview',
hitTestBehavior: PlatformViewHitTestBehavior.opaque, hitTestBehavior: PlatformViewHitTestBehavior.opaque,
), ),
) ),
), ),
], ],
), ),
...@@ -309,10 +309,10 @@ void main() { ...@@ -309,10 +309,10 @@ void main() {
await tester.startGesture(const Offset(50.0, 50.0)); await tester.startGesture(const Offset(50.0, 50.0));
expect( expect(
viewsController.motionEvents[currentViewId + 1], viewsController.motionEvents[currentViewId + 1],
orderedEquals(<FakeMotionEvent> [ orderedEquals(<FakeMotionEvent> [
const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(50.0, 50.0)]), const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(50.0, 50.0)]),
]) ]),
); );
expect( expect(
numPointerDownsOnParent, numPointerDownsOnParent,
...@@ -325,28 +325,28 @@ void main() { ...@@ -325,28 +325,28 @@ void main() {
final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android); final FakePlatformViewsController viewsController = new FakePlatformViewsController(TargetPlatform.android);
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
await tester.pumpWidget( await tester.pumpWidget(
new Align( new Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: new Container( child: new Container(
margin: const EdgeInsets.all(10.0), margin: const EdgeInsets.all(10.0),
child: const SizedBox( child: const SizedBox(
width: 200.0, width: 200.0,
height: 100.0, height: 100.0,
child: AndroidView(viewType: 'webview'), child: AndroidView(viewType: 'webview'),
),
), ),
) ),
),
); );
final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0));
await gesture.up(); await gesture.up();
expect( expect(
viewsController.motionEvents[currentViewId + 1], viewsController.motionEvents[currentViewId + 1],
orderedEquals(<FakeMotionEvent> [ orderedEquals(<FakeMotionEvent> [
const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(40.0, 40.0)]), const FakeMotionEvent(AndroidViewController.kActionDown, <int> [0], <Offset> [Offset(40.0, 40.0)]),
const FakeMotionEvent(AndroidViewController.kActionUp, <int> [0], <Offset> [Offset(40.0, 40.0)]), const FakeMotionEvent(AndroidViewController.kActionUp, <int> [0], <Offset> [Offset(40.0, 40.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