diff --git a/packages/flutter_test/lib/flutter_test.dart b/packages/flutter_test/lib/flutter_test.dart new file mode 100644 index 0000000000..9ba1d17a47 --- /dev/null +++ b/packages/flutter_test/lib/flutter_test.dart @@ -0,0 +1,8 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +library flutter_test; + +export 'src/test_pointer.dart'; +export 'src/widget_tester.dart'; diff --git a/packages/unit/test/engine/mock_events.dart b/packages/flutter_test/lib/src/test_pointer.dart similarity index 89% rename from packages/unit/test/engine/mock_events.dart rename to packages/flutter_test/lib/src/test_pointer.dart index 0255708bfb..49ed767986 100644 --- a/packages/unit/test/engine/mock_events.dart +++ b/packages/flutter_test/lib/src/test_pointer.dart @@ -1,3 +1,7 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + import 'dart:ui' as ui; import 'package:flutter/gestures.dart'; diff --git a/packages/unit/test/widget/widget_tester.dart b/packages/flutter_test/lib/src/widget_tester.dart similarity index 92% rename from packages/unit/test/widget/widget_tester.dart rename to packages/flutter_test/lib/src/widget_tester.dart index 5d24a8fcd6..3489ecc888 100644 --- a/packages/unit/test/widget/widget_tester.dart +++ b/packages/flutter_test/lib/src/widget_tester.dart @@ -11,24 +11,7 @@ import 'package:flutter/widgets.dart'; import 'package:quiver/testing/async.dart'; import 'package:quiver/time.dart'; -import '../engine/mock_events.dart'; - -class RootComponent extends StatefulComponent { - RootComponentState createState() => new RootComponentState(); -} - -class RootComponentState extends State { - Widget _child = new DecoratedBox(decoration: new BoxDecoration()); - Widget get child => _child; - void set child(Widget value) { - if (value != _child) { - setState(() { - _child = value; - }); - } - } - Widget build(BuildContext context) => child; -} +import 'test_pointer.dart'; typedef Point SizeToPointFunction(Size size); diff --git a/packages/flutter_test/pubspec.yaml b/packages/flutter_test/pubspec.yaml new file mode 100644 index 0000000000..b286981ab9 --- /dev/null +++ b/packages/flutter_test/pubspec.yaml @@ -0,0 +1,10 @@ +name: flutter_test +dependencies: + test: ^0.12.5 + quiver: ^0.21.4 + flutter: + path: ../flutter + + # So that the test harness is available when running the tests. + flutter_tools: + path: ../flutter_tools diff --git a/packages/unit/benchmark/stocks/animation_bench.dart b/packages/unit/benchmark/stocks/animation_bench.dart index 869d9bad7a..bec8781e55 100644 --- a/packages/unit/benchmark/stocks/animation_bench.dart +++ b/packages/unit/benchmark/stocks/animation_bench.dart @@ -1,10 +1,10 @@ import 'dart:io'; -import 'package:flutter/rendering.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:stocks/main.dart' as stocks; import 'package:stocks/stock_data.dart' as stock_data; -import '../../test/widget/widget_tester.dart'; const int _kNumberOfIterations = 50000; const bool _kRunForever = false; diff --git a/packages/unit/benchmark/stocks/build_bench.dart b/packages/unit/benchmark/stocks/build_bench.dart index 23c674277e..6815e9c24c 100644 --- a/packages/unit/benchmark/stocks/build_bench.dart +++ b/packages/unit/benchmark/stocks/build_bench.dart @@ -1,10 +1,10 @@ import 'dart:io'; -import 'package:flutter/rendering.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:stocks/main.dart' as stocks; import 'package:stocks/stock_data.dart' as stock_data; -import '../../test/widget/widget_tester.dart'; const int _kNumberOfIterations = 100000; const bool _kRunForever = false; diff --git a/packages/unit/benchmark/stocks/layout_bench.dart b/packages/unit/benchmark/stocks/layout_bench.dart index 285a19801b..11adc48032 100644 --- a/packages/unit/benchmark/stocks/layout_bench.dart +++ b/packages/unit/benchmark/stocks/layout_bench.dart @@ -1,10 +1,10 @@ import 'dart:io'; -import 'package:flutter/rendering.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:stocks/main.dart' as stocks; import 'package:stocks/stock_data.dart' as stock_data; -import '../../test/widget/widget_tester.dart'; const int _kNumberOfIterations = 100000; const bool _kRunForever = false; diff --git a/packages/unit/pubspec.yaml b/packages/unit/pubspec.yaml index 41f9d23342..6b5440b738 100644 --- a/packages/unit/pubspec.yaml +++ b/packages/unit/pubspec.yaml @@ -1,13 +1,10 @@ name: flutter_unit_tests dependencies: - test: ^0.12.5 - quiver: ^0.21.4 flx: path: ../flx flutter: path: ../flutter + flutter_test: + path: ../flutter_test stocks: path: ../../examples/stocks - # To ensure the version of test doesn't get out of sync. - flutter_tools: - path: ../flutter_tools diff --git a/packages/unit/test/gestures/pointer_router_test.dart b/packages/unit/test/gestures/pointer_router_test.dart index a89f469430..994e9254f5 100644 --- a/packages/unit/test/gestures/pointer_router_test.dart +++ b/packages/unit/test/gestures/pointer_router_test.dart @@ -1,8 +1,7 @@ +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/gestures.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; - void main() { test('Should route pointers', () { bool callbackRan = false; diff --git a/packages/unit/test/gestures/scale_test.dart b/packages/unit/test/gestures/scale_test.dart index 149d14be0a..8ff5e422df 100644 --- a/packages/unit/test/gestures/scale_test.dart +++ b/packages/unit/test/gestures/scale_test.dart @@ -1,10 +1,9 @@ import 'dart:ui' as ui; +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/gestures.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; - void main() { test('Should recognize scale gestures', () { PointerRouter router = new PointerRouter(); diff --git a/packages/unit/test/gestures/scroll_test.dart b/packages/unit/test/gestures/scroll_test.dart index 9c1c049216..b4d5c32f8c 100644 --- a/packages/unit/test/gestures/scroll_test.dart +++ b/packages/unit/test/gestures/scroll_test.dart @@ -1,10 +1,9 @@ import 'dart:ui' as ui; +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/gestures.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; - void main() { test('Should recognize pan', () { PointerRouter router = new PointerRouter(); diff --git a/packages/unit/test/widget/align_test.dart b/packages/unit/test/widget/align_test.dart index 6a42aee908..7081dbbf56 100644 --- a/packages/unit/test/widget/align_test.dart +++ b/packages/unit/test/widget/align_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Align smoke test', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/animated_container_test.dart b/packages/unit/test/widget/animated_container_test.dart index b048e0e334..0132ac9922 100644 --- a/packages/unit/test/widget/animated_container_test.dart +++ b/packages/unit/test/widget/animated_container_test.dart @@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/animation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('AnimatedContainer control test', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/block_test.dart b/packages/unit/test/widget/block_test.dart index 88075291fe..74f7dc48de 100644 --- a/packages/unit/test/widget/block_test.dart +++ b/packages/unit/test/widget/block_test.dart @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; -import 'widget_tester.dart'; - final Key blockKey = new Key('test'); void main() { diff --git a/packages/unit/test/widget/bottom_sheet_test.dart b/packages/unit/test/widget/bottom_sheet_test.dart index 4f07baf0bc..e9d42469cc 100644 --- a/packages/unit/test/widget/bottom_sheet_test.dart +++ b/packages/unit/test/widget/bottom_sheet_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Verify that a tap dismisses a modal BottomSheet', () { testWidgets((WidgetTester tester) { @@ -79,7 +78,7 @@ void main() { expect(showBottomSheetThenCalled, isFalse); expect(tester.findText('BottomSheet'), isNull); - scaffoldKey.currentState.showBottomSheet((BuildContext context) { + scaffoldKey.currentState.showBottomSheet((BuildContext context) { return new Container( margin: new EdgeDims.all(40.0), child: new Text('BottomSheet') diff --git a/packages/unit/test/widget/box_decoration_test.dart b/packages/unit/test/widget/box_decoration_test.dart index 01bad08c47..ba7df219a9 100644 --- a/packages/unit/test/widget/box_decoration_test.dart +++ b/packages/unit/test/widget/box_decoration_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Circles can have uniform borders', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/build_scope_test.dart b/packages/unit/test/widget/build_scope_test.dart index 0df49a94b2..891f983012 100644 --- a/packages/unit/test/widget/build_scope_test.dart +++ b/packages/unit/test/widget/build_scope_test.dart @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/animation.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; import 'test_widgets.dart'; class ProbeWidget extends StatefulComponent { diff --git a/packages/unit/test/widget/center_test.dart b/packages/unit/test/widget/center_test.dart index f5a7d0fa90..303319650f 100644 --- a/packages/unit/test/widget/center_test.dart +++ b/packages/unit/test/widget/center_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Can be placed in an infinte box', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/coordinates_test.dart b/packages/unit/test/widget/coordinates_test.dart index a6d658bdf6..76fe790464 100644 --- a/packages/unit/test/widget/coordinates_test.dart +++ b/packages/unit/test/widget/coordinates_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Comparing coordinates', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/custom_multi_child_layout_test.dart b/packages/unit/test/widget/custom_multi_child_layout_test.dart index 3fc36f2e3d..96c83a8de4 100644 --- a/packages/unit/test/widget/custom_multi_child_layout_test.dart +++ b/packages/unit/test/widget/custom_multi_child_layout_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class TestMultiChildLayoutDelegate extends MultiChildLayoutDelegate { BoxConstraints getSizeConstraints; diff --git a/packages/unit/test/widget/custom_one_child_layout_test.dart b/packages/unit/test/widget/custom_one_child_layout_test.dart index 521216bb11..33dd94c0c8 100644 --- a/packages/unit/test/widget/custom_one_child_layout_test.dart +++ b/packages/unit/test/widget/custom_one_child_layout_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class TestOneChildLayoutDelegate extends OneChildLayoutDelegate { BoxConstraints constraintsFromGetSize; BoxConstraints constraintsFromGetConstraintsForChild; diff --git a/packages/unit/test/widget/date_picker_test.dart b/packages/unit/test/widget/date_picker_test.dart index e6459385b6..b2cae885d2 100644 --- a/packages/unit/test/widget/date_picker_test.dart +++ b/packages/unit/test/widget/date_picker_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Can select a day', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/dismissable_test.dart b/packages/unit/test/widget/dismissable_test.dart index a2f928b6ae..f0a6513cd3 100644 --- a/packages/unit/test/widget/dismissable_test.dart +++ b/packages/unit/test/widget/dismissable_test.dart @@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; -import 'widget_tester.dart'; - const double itemExtent = 100.0; ScrollDirection scrollDirection = ScrollDirection.vertical; DismissDirection dismissDirection = DismissDirection.horizontal; @@ -284,4 +282,3 @@ void main() { }); }); } - diff --git a/packages/unit/test/widget/draggable_test.dart b/packages/unit/test/widget/draggable_test.dart index 96e0d9d050..62d5f46960 100644 --- a/packages/unit/test/widget/draggable_test.dart +++ b/packages/unit/test/widget/draggable_test.dart @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; -import 'widget_tester.dart'; - void main() { test('Drag and drop - control test', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/drawer_test.dart b/packages/unit/test/widget/drawer_test.dart index 9e10faabeb..939277ff8c 100644 --- a/packages/unit/test/widget/drawer_test.dart +++ b/packages/unit/test/widget/drawer_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Drawer control test', () { diff --git a/packages/unit/test/widget/duplicate_key_test.dart b/packages/unit/test/widget/duplicate_key_test.dart index dec4f9be1d..8fcc128d8b 100644 --- a/packages/unit/test/widget/duplicate_key_test.dart +++ b/packages/unit/test/widget/duplicate_key_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class Item { GlobalKey key1 = new GlobalKey(); GlobalKey key2 = new GlobalKey(); diff --git a/packages/unit/test/widget/flex_test.dart b/packages/unit/test/widget/flex_test.dart index 3d0316ce9f..66760210d7 100644 --- a/packages/unit/test/widget/flex_test.dart +++ b/packages/unit/test/widget/flex_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Can hit test flex children of stacks', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/focus_test.dart b/packages/unit/test/widget/focus_test.dart index 0c51130eed..68deb6e68b 100644 --- a/packages/unit/test/widget/focus_test.dart +++ b/packages/unit/test/widget/focus_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class TestFocusable extends StatelessComponent { TestFocusable(this.no, this.yes, GlobalKey key) : super(key: key); final String no; diff --git a/packages/unit/test/widget/fractionally_sized_box_test.dart b/packages/unit/test/widget/fractionally_sized_box_test.dart index 9147fd3c59..ad3055d3c0 100644 --- a/packages/unit/test/widget/fractionally_sized_box_test.dart +++ b/packages/unit/test/widget/fractionally_sized_box_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('FractionallySizedBox', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/gesture_detector_test.dart b/packages/unit/test/widget/gesture_detector_test.dart index d83f16a0b5..8e5dfcd46a 100644 --- a/packages/unit/test/widget/gesture_detector_test.dart +++ b/packages/unit/test/widget/gesture_detector_test.dart @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; -import 'widget_tester.dart'; - void main() { test('Uncontested scrolls start immediately', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/heroes_test.dart b/packages/unit/test/widget/heroes_test.dart index 66d386b240..5d6ea2e368 100644 --- a/packages/unit/test/widget/heroes_test.dart +++ b/packages/unit/test/widget/heroes_test.dart @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; import 'test_matchers.dart'; -import 'widget_tester.dart'; Key firstKey = new Key('first'); Key secondKey = new Key('second'); diff --git a/packages/unit/test/widget/homogeneous_viewport_test.dart b/packages/unit/test/widget/homogeneous_viewport_test.dart index 85dd1ac3f2..d9f3c1978e 100644 --- a/packages/unit/test/widget/homogeneous_viewport_test.dart +++ b/packages/unit/test/widget/homogeneous_viewport_test.dart @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; import 'test_widgets.dart'; void main() { diff --git a/packages/unit/test/widget/init_state_test.dart b/packages/unit/test/widget/init_state_test.dart index f21fb8565d..23b9cb0f94 100644 --- a/packages/unit/test/widget/init_state_test.dart +++ b/packages/unit/test/widget/init_state_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - List ancestors = []; class TestComponent extends StatefulComponent { diff --git a/packages/unit/test/widget/input_test.dart b/packages/unit/test/widget/input_test.dart index e1796a0c6e..58ae46ba25 100644 --- a/packages/unit/test/widget/input_test.dart +++ b/packages/unit/test/widget/input_test.dart @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:mojo_services/keyboard/keyboard.mojom.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; -import 'package:flutter/material.dart'; +import 'package:mojo_services/keyboard/keyboard.mojom.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; import '../services/mock_services.dart'; class MockKeyboard implements KeyboardService { diff --git a/packages/unit/test/widget/listener_test.dart b/packages/unit/test/widget/listener_test.dart index 65014fc606..bf0af80281 100644 --- a/packages/unit/test/widget/listener_test.dart +++ b/packages/unit/test/widget/listener_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Events bubble up the tree', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/mixed_viewport_test.dart b/packages/unit/test/widget/mixed_viewport_test.dart index 6bf63135f7..ccf276c0dc 100644 --- a/packages/unit/test/widget/mixed_viewport_test.dart +++ b/packages/unit/test/widget/mixed_viewport_test.dart @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; import 'test_widgets.dart'; void main() { diff --git a/packages/unit/test/widget/multichild_test.dart b/packages/unit/test/widget/multichild_test.dart index bbd6be6e23..6e813766e0 100644 --- a/packages/unit/test/widget/multichild_test.dart +++ b/packages/unit/test/widget/multichild_test.dart @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; import 'test_widgets.dart'; -import 'widget_tester.dart'; void checkTree(WidgetTester tester, List expectedDecorations) { MultiChildRenderObjectElement element = diff --git a/packages/unit/test/widget/navigator_test.dart b/packages/unit/test/widget/navigator_test.dart index 0252798dc9..3b825c9d04 100644 --- a/packages/unit/test/widget/navigator_test.dart +++ b/packages/unit/test/widget/navigator_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class FirstComponent extends StatelessComponent { Widget build(BuildContext context) { return new GestureDetector( diff --git a/packages/unit/test/widget/page_transitions_test.dart b/packages/unit/test/widget/page_transitions_test.dart index 99fee93563..8efc4a32bd 100644 --- a/packages/unit/test/widget/page_transitions_test.dart +++ b/packages/unit/test/widget/page_transitions_test.dart @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; import 'test_matchers.dart'; -import 'widget_tester.dart'; class TestOverlayRoute extends OverlayRoute { List get builders => [ _build ]; diff --git a/packages/unit/test/widget/pageable_list_test.dart b/packages/unit/test/widget/pageable_list_test.dart index ce3e6358bb..2864da8ffb 100644 --- a/packages/unit/test/widget/pageable_list_test.dart +++ b/packages/unit/test/widget/pageable_list_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - const Size pageSize = const Size(800.0, 600.0); const List pages = const [0, 1, 2, 3, 4, 5]; int currentPage = null; diff --git a/packages/unit/test/widget/parent_data_test.dart b/packages/unit/test/widget/parent_data_test.dart index 6307fd747a..2557b36d22 100644 --- a/packages/unit/test/widget/parent_data_test.dart +++ b/packages/unit/test/widget/parent_data_test.dart @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; import 'test_widgets.dart'; -import 'widget_tester.dart'; class TestParentData { TestParentData({ this.top, this.right, this.bottom, this.left }); diff --git a/packages/unit/test/widget/positioned_test.dart b/packages/unit/test/widget/positioned_test.dart index 8c12b36a14..120a02bd67 100644 --- a/packages/unit/test/widget/positioned_test.dart +++ b/packages/unit/test/widget/positioned_test.dart @@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/animation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Can animate position data', () { diff --git a/packages/unit/test/widget/progress_indicator_test.dart b/packages/unit/test/widget/progress_indicator_test.dart index cbd5ac59ce..f19bad9a05 100644 --- a/packages/unit/test/widget/progress_indicator_test.dart +++ b/packages/unit/test/widget/progress_indicator_test.dart @@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('LinearProgressIndicator changes when its value changes', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/remember_scroll_position_test.dart b/packages/unit/test/widget/remember_scroll_position_test.dart index 341adc2197..51e34c053b 100644 --- a/packages/unit/test/widget/remember_scroll_position_test.dart +++ b/packages/unit/test/widget/remember_scroll_position_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/animation.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class ThePositiveNumbers extends ScrollableWidgetList { ThePositiveNumbers() : super(itemExtent: 100.0); ThePositiveNumbersState createState() => new ThePositiveNumbersState(); diff --git a/packages/unit/test/widget/render_object_widget_test.dart b/packages/unit/test/widget/render_object_widget_test.dart index eaccd4be23..4d89371f14 100644 --- a/packages/unit/test/widget/render_object_widget_test.dart +++ b/packages/unit/test/widget/render_object_widget_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - final BoxDecoration kBoxDecorationA = new BoxDecoration(); final BoxDecoration kBoxDecorationB = new BoxDecoration(); final BoxDecoration kBoxDecorationC = new BoxDecoration(); diff --git a/packages/unit/test/widget/reparent_state_test.dart b/packages/unit/test/widget/reparent_state_test.dart index e82ae43432..964c3e7bc1 100644 --- a/packages/unit/test/widget/reparent_state_test.dart +++ b/packages/unit/test/widget/reparent_state_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class StateMarker extends StatefulComponent { StateMarker({ Key key, this.child }) : super(key: key); diff --git a/packages/unit/test/widget/scrollable_list_hit_testing_test.dart b/packages/unit/test/widget/scrollable_list_hit_testing_test.dart index a0023d096c..4c08907ea6 100644 --- a/packages/unit/test/widget/scrollable_list_hit_testing_test.dart +++ b/packages/unit/test/widget/scrollable_list_hit_testing_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - const List items = const [0, 1, 2, 3, 4, 5]; List tapped = []; diff --git a/packages/unit/test/widget/scrollable_list_horizontal_test.dart b/packages/unit/test/widget/scrollable_list_horizontal_test.dart index a6821739be..520022ede9 100644 --- a/packages/unit/test/widget/scrollable_list_horizontal_test.dart +++ b/packages/unit/test/widget/scrollable_list_horizontal_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - const List items = const [0, 1, 2, 3, 4, 5]; Widget buildFrame() { diff --git a/packages/unit/test/widget/scrollable_list_vertical_test.dart b/packages/unit/test/widget/scrollable_list_vertical_test.dart index c258b076a5..bd0df9784a 100644 --- a/packages/unit/test/widget/scrollable_list_vertical_test.dart +++ b/packages/unit/test/widget/scrollable_list_vertical_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - const List items = const [0, 1, 2, 3, 4, 5]; Widget buildFrame() { diff --git a/packages/unit/test/widget/scrollable_list_with_inherited_test.dart b/packages/unit/test/widget/scrollable_list_with_inherited_test.dart index 4c08334874..f186fac8b9 100644 --- a/packages/unit/test/widget/scrollable_list_with_inherited_test.dart +++ b/packages/unit/test/widget/scrollable_list_with_inherited_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - List items = [0, 1, 2, 3, 4, 5]; Widget buildCard(BuildContext context, int index) { diff --git a/packages/unit/test/widget/set_state_3_test.dart b/packages/unit/test/widget/set_state_3_test.dart index fcf2372fdf..9b7bacf682 100644 --- a/packages/unit/test/widget/set_state_3_test.dart +++ b/packages/unit/test/widget/set_state_3_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - ChangerState changer; class Changer extends StatefulComponent { diff --git a/packages/unit/test/widget/set_state_test.dart b/packages/unit/test/widget/set_state_test.dart index 848a656550..2c78e7e92e 100644 --- a/packages/unit/test/widget/set_state_test.dart +++ b/packages/unit/test/widget/set_state_test.dart @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import '../engine/mock_events.dart'; -import 'widget_tester.dart'; - class Inside extends StatefulComponent { InsideState createState() => new InsideState(); } diff --git a/packages/unit/test/widget/shader_mask_test.dart b/packages/unit/test/widget/shader_mask_test.dart index 784816ab8b..51df395b24 100644 --- a/packages/unit/test/widget/shader_mask_test.dart +++ b/packages/unit/test/widget/shader_mask_test.dart @@ -4,12 +4,11 @@ import 'dart:ui' as ui; +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/painting.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - ui.Shader createShader(Rect bounds) { return new LinearGradient( begin: Point.origin, diff --git a/packages/unit/test/widget/size_observer_test.dart b/packages/unit/test/widget/size_observer_test.dart index 300c903d85..cc8dd5247b 100644 --- a/packages/unit/test/widget/size_observer_test.dart +++ b/packages/unit/test/widget/size_observer_test.dart @@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('SizeObserver notices zero size', () { testWidgets((WidgetTester tester) { diff --git a/packages/unit/test/widget/snack_bar_test.dart b/packages/unit/test/widget/snack_bar_test.dart index 89a9b707d6..f3a11bd451 100644 --- a/packages/unit/test/widget/snack_bar_test.dart +++ b/packages/unit/test/widget/snack_bar_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class Builder extends StatelessComponent { Builder({ this.builder }); final WidgetBuilder builder; @@ -55,7 +54,7 @@ void main() { expect(tester.findText(helloSnackBar), isNotNull); tester.pump(new Duration(milliseconds: 750)); // 1.50s expect(tester.findText(helloSnackBar), isNotNull); - tester.pump(new Duration(milliseconds: 750)); // 2.25s + tester.pump(new Duration(milliseconds: 750)); // 2.25s expect(tester.findText(helloSnackBar), isNotNull); tester.pump(new Duration(milliseconds: 750)); // 3.00s // timer triggers to dismiss snackbar, reverse animation is scheduled tester.pump(); // begin animation @@ -114,7 +113,7 @@ void main() { tester.pump(new Duration(milliseconds: 750)); // 1.50s expect(tester.findText('bar1'), isNotNull); expect(tester.findText('bar2'), isNull); - tester.pump(new Duration(milliseconds: 750)); // 2.25s + tester.pump(new Duration(milliseconds: 750)); // 2.25s expect(tester.findText('bar1'), isNotNull); expect(tester.findText('bar2'), isNull); tester.pump(new Duration(milliseconds: 750)); // 3.00s // timer triggers to dismiss snackbar, reverse animation is scheduled @@ -133,7 +132,7 @@ void main() { tester.pump(new Duration(milliseconds: 750)); // 5.25s expect(tester.findText('bar1'), isNull); expect(tester.findText('bar2'), isNotNull); - tester.pump(new Duration(milliseconds: 750)); // 6.00s + tester.pump(new Duration(milliseconds: 750)); // 6.00s expect(tester.findText('bar1'), isNull); expect(tester.findText('bar2'), isNotNull); tester.pump(new Duration(milliseconds: 750)); // 6.75s // timer triggers to dismiss snackbar, reverse animation is scheduled @@ -200,10 +199,10 @@ void main() { tester.pump(new Duration(milliseconds: 750)); // 1.50s expect(tester.findText('bar1'), isNotNull); expect(tester.findText('bar2'), isNull); - tester.pump(new Duration(milliseconds: 750)); // 2.25s + tester.pump(new Duration(milliseconds: 750)); // 2.25s expect(tester.findText('bar1'), isNotNull); expect(tester.findText('bar2'), isNull); - tester.pump(new Duration(milliseconds: 10000)); // 12.25s + tester.pump(new Duration(milliseconds: 10000)); // 12.25s expect(tester.findText('bar1'), isNotNull); expect(tester.findText('bar2'), isNull); @@ -225,7 +224,7 @@ void main() { tester.pump(new Duration(milliseconds: 750)); // 15.25s expect(tester.findText('bar1'), isNull); expect(tester.findText('bar2'), isNotNull); - tester.pump(new Duration(milliseconds: 750)); // 16.00s + tester.pump(new Duration(milliseconds: 750)); // 16.00s expect(tester.findText('bar1'), isNull); expect(tester.findText('bar2'), isNotNull); tester.pump(new Duration(milliseconds: 750)); // 16.75s // timer triggers to dismiss snackbar, reverse animation is scheduled diff --git a/packages/unit/test/widget/snap_scrolling_test.dart b/packages/unit/test/widget/snap_scrolling_test.dart index d736ed9a03..c1d93f342e 100644 --- a/packages/unit/test/widget/snap_scrolling_test.dart +++ b/packages/unit/test/widget/snap_scrolling_test.dart @@ -4,11 +4,10 @@ import 'dart:async'; +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - const double itemExtent = 200.0; ScrollDirection scrollDirection = ScrollDirection.vertical; GlobalKey scrollableListKey; diff --git a/packages/unit/test/widget/stack_test.dart b/packages/unit/test/widget/stack_test.dart index 4bb7319330..013dde6892 100644 --- a/packages/unit/test/widget/stack_test.dart +++ b/packages/unit/test/widget/stack_test.dart @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; import '../rendering/rendering_tester.dart'; void main() { diff --git a/packages/unit/test/widget/stateful_component_test.dart b/packages/unit/test/widget/stateful_component_test.dart index 45a116c587..c85b290cb7 100644 --- a/packages/unit/test/widget/stateful_component_test.dart +++ b/packages/unit/test/widget/stateful_component_test.dart @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; import 'test_widgets.dart'; void main() { diff --git a/packages/unit/test/widget/stateful_components_test.dart b/packages/unit/test/widget/stateful_components_test.dart index 8f67396cd0..1e4716cc37 100644 --- a/packages/unit/test/widget/stateful_components_test.dart +++ b/packages/unit/test/widget/stateful_components_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class InnerComponent extends StatefulComponent { InnerComponent({ Key key }) : super(key: key); InnerComponentState createState() => new InnerComponentState(); diff --git a/packages/unit/test/widget/syncing_test.dart b/packages/unit/test/widget/syncing_test.dart index a2b2f28a05..6d480b8dba 100644 --- a/packages/unit/test/widget/syncing_test.dart +++ b/packages/unit/test/widget/syncing_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - class TestWidget extends StatefulComponent { TestWidget({ this.child, this.persistentState, this.syncedState }); diff --git a/packages/unit/test/widget/tabs_test.dart b/packages/unit/test/widget/tabs_test.dart index e4e64e93fd..2c2c2500ba 100644 --- a/packages/unit/test/widget/tabs_test.dart +++ b/packages/unit/test/widget/tabs_test.dart @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - int selectedIndex = 2; Widget buildFrame({ List tabs, bool isScrollable: false }) { diff --git a/packages/unit/test/widget/test_widgets.dart b/packages/unit/test/widget/test_widgets.dart index 381368947e..9eaaaf4d78 100644 --- a/packages/unit/test/widget/test_widgets.dart +++ b/packages/unit/test/widget/test_widgets.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - final BoxDecoration kBoxDecorationA = new BoxDecoration( backgroundColor: const Color(0xFFFF0000) ); diff --git a/packages/unit/test/widget/transform_test.dart b/packages/unit/test/widget/transform_test.dart index 95e0295eab..e001e9cf48 100644 --- a/packages/unit/test/widget/transform_test.dart +++ b/packages/unit/test/widget/transform_test.dart @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -import 'widget_tester.dart'; - void main() { test('Transform origin', () { testWidgets((WidgetTester tester) {