Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
8ac88d5a
Commit
8ac88d5a
authored
Nov 23, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #555 from abarth/flutter_test2
Add package:flutter_test
parents
587b5bce
727ce65f
Changes
63
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
95 additions
and
146 deletions
+95
-146
flutter_test.dart
packages/flutter_test/lib/flutter_test.dart
+8
-0
test_pointer.dart
packages/flutter_test/lib/src/test_pointer.dart
+4
-0
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+1
-18
pubspec.yaml
packages/flutter_test/pubspec.yaml
+10
-0
animation_bench.dart
packages/unit/benchmark/stocks/animation_bench.dart
+2
-2
build_bench.dart
packages/unit/benchmark/stocks/build_bench.dart
+2
-2
layout_bench.dart
packages/unit/benchmark/stocks/layout_bench.dart
+2
-2
pubspec.yaml
packages/unit/pubspec.yaml
+2
-5
pointer_router_test.dart
packages/unit/test/gestures/pointer_router_test.dart
+1
-2
scale_test.dart
packages/unit/test/gestures/scale_test.dart
+1
-2
scroll_test.dart
packages/unit/test/gestures/scroll_test.dart
+1
-2
align_test.dart
packages/unit/test/widget/align_test.dart
+1
-2
animated_container_test.dart
packages/unit/test/widget/animated_container_test.dart
+1
-2
block_test.dart
packages/unit/test/widget/block_test.dart
+1
-3
bottom_sheet_test.dart
packages/unit/test/widget/bottom_sheet_test.dart
+2
-3
box_decoration_test.dart
packages/unit/test/widget/box_decoration_test.dart
+1
-2
build_scope_test.dart
packages/unit/test/widget/build_scope_test.dart
+1
-1
center_test.dart
packages/unit/test/widget/center_test.dart
+1
-2
coordinates_test.dart
packages/unit/test/widget/coordinates_test.dart
+1
-2
custom_multi_child_layout_test.dart
...ages/unit/test/widget/custom_multi_child_layout_test.dart
+1
-2
custom_one_child_layout_test.dart
packages/unit/test/widget/custom_one_child_layout_test.dart
+1
-2
date_picker_test.dart
packages/unit/test/widget/date_picker_test.dart
+1
-2
dismissable_test.dart
packages/unit/test/widget/dismissable_test.dart
+1
-4
draggable_test.dart
packages/unit/test/widget/draggable_test.dart
+1
-3
drawer_test.dart
packages/unit/test/widget/drawer_test.dart
+1
-2
duplicate_key_test.dart
packages/unit/test/widget/duplicate_key_test.dart
+1
-2
flex_test.dart
packages/unit/test/widget/flex_test.dart
+1
-2
focus_test.dart
packages/unit/test/widget/focus_test.dart
+1
-2
fractionally_sized_box_test.dart
packages/unit/test/widget/fractionally_sized_box_test.dart
+1
-2
gesture_detector_test.dart
packages/unit/test/widget/gesture_detector_test.dart
+1
-3
heroes_test.dart
packages/unit/test/widget/heroes_test.dart
+1
-1
homogeneous_viewport_test.dart
packages/unit/test/widget/homogeneous_viewport_test.dart
+1
-1
init_state_test.dart
packages/unit/test/widget/init_state_test.dart
+1
-2
input_test.dart
packages/unit/test/widget/input_test.dart
+3
-3
listener_test.dart
packages/unit/test/widget/listener_test.dart
+1
-2
mixed_viewport_test.dart
packages/unit/test/widget/mixed_viewport_test.dart
+1
-1
multichild_test.dart
packages/unit/test/widget/multichild_test.dart
+1
-1
navigator_test.dart
packages/unit/test/widget/navigator_test.dart
+1
-2
page_transitions_test.dart
packages/unit/test/widget/page_transitions_test.dart
+1
-1
pageable_list_test.dart
packages/unit/test/widget/pageable_list_test.dart
+1
-2
parent_data_test.dart
packages/unit/test/widget/parent_data_test.dart
+1
-1
positioned_test.dart
packages/unit/test/widget/positioned_test.dart
+1
-2
progress_indicator_test.dart
packages/unit/test/widget/progress_indicator_test.dart
+1
-3
remember_scroll_position_test.dart
packages/unit/test/widget/remember_scroll_position_test.dart
+1
-2
render_object_widget_test.dart
packages/unit/test/widget/render_object_widget_test.dart
+1
-2
reparent_state_test.dart
packages/unit/test/widget/reparent_state_test.dart
+1
-2
scrollable_list_hit_testing_test.dart
...es/unit/test/widget/scrollable_list_hit_testing_test.dart
+1
-2
scrollable_list_horizontal_test.dart
...ges/unit/test/widget/scrollable_list_horizontal_test.dart
+1
-2
scrollable_list_vertical_test.dart
packages/unit/test/widget/scrollable_list_vertical_test.dart
+1
-2
scrollable_list_with_inherited_test.dart
...unit/test/widget/scrollable_list_with_inherited_test.dart
+1
-2
set_state_3_test.dart
packages/unit/test/widget/set_state_3_test.dart
+1
-2
set_state_test.dart
packages/unit/test/widget/set_state_test.dart
+1
-3
shader_mask_test.dart
packages/unit/test/widget/shader_mask_test.dart
+1
-2
size_observer_test.dart
packages/unit/test/widget/size_observer_test.dart
+1
-3
snack_bar_test.dart
packages/unit/test/widget/snack_bar_test.dart
+7
-8
snap_scrolling_test.dart
packages/unit/test/widget/snap_scrolling_test.dart
+1
-2
stack_test.dart
packages/unit/test/widget/stack_test.dart
+1
-1
stateful_component_test.dart
packages/unit/test/widget/stateful_component_test.dart
+1
-1
stateful_components_test.dart
packages/unit/test/widget/stateful_components_test.dart
+1
-2
syncing_test.dart
packages/unit/test/widget/syncing_test.dart
+1
-2
tabs_test.dart
packages/unit/test/widget/tabs_test.dart
+1
-2
test_widgets.dart
packages/unit/test/widget/test_widgets.dart
+1
-2
transform_test.dart
packages/unit/test/widget/transform_test.dart
+1
-2
No files found.
packages/flutter_test/lib/flutter_test.dart
0 → 100644
View file @
8ac88d5a
// 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'
;
packages/
unit/test/engine/mock_events
.dart
→
packages/
flutter_test/lib/src/test_pointer
.dart
View file @
8ac88d5a
// 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'
;
...
...
packages/
unit/test/widget
/widget_tester.dart
→
packages/
flutter_test/lib/src
/widget_tester.dart
View file @
8ac88d5a
...
...
@@ -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
<
RootComponent
>
{
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
);
...
...
packages/flutter_test/pubspec.yaml
0 → 100644
View file @
8ac88d5a
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
packages/unit/benchmark/stocks/animation_bench.dart
View file @
8ac88d5a
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
;
...
...
packages/unit/benchmark/stocks/build_bench.dart
View file @
8ac88d5a
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
;
...
...
packages/unit/benchmark/stocks/layout_bench.dart
View file @
8ac88d5a
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
;
...
...
packages/unit/pubspec.yaml
View file @
8ac88d5a
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
packages/unit/test/gestures/pointer_router_test.dart
View file @
8ac88d5a
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
;
...
...
packages/unit/test/gestures/scale_test.dart
View file @
8ac88d5a
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
();
...
...
packages/unit/test/gestures/scroll_test.dart
View file @
8ac88d5a
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
();
...
...
packages/unit/test/widget/align_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/animated_container_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/block_test.dart
View file @
8ac88d5a
...
...
@@ -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
(
)
{
...
...
packages/unit/test/widget/bottom_sheet_test.dart
View file @
8ac88d5a
...
...
@@ -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'
)
...
...
packages/unit/test/widget/box_decoration_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/build_scope_test.dart
View file @
8ac88d5a
...
...
@@ -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
{
...
...
packages/unit/test/widget/center_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/coordinates_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/custom_multi_child_layout_test.dart
View file @
8ac88d5a
...
...
@@ -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
;
...
...
packages/unit/test/widget/custom_one_child_layout_test.dart
View file @
8ac88d5a
...
...
@@ -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
;
...
...
packages/unit/test/widget/date_picker_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/dismissable_test.dart
View file @
8ac88d5a
...
...
@@ -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() {
});
});
}
packages/unit/test/widget/draggable_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/drawer_test.dart
View file @
8ac88d5a
...
...
@@ -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'
,
()
{
...
...
packages/unit/test/widget/duplicate_key_test.dart
View file @
8ac88d5a
...
...
@@ -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
();
...
...
packages/unit/test/widget/flex_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/focus_test.dart
View file @
8ac88d5a
...
...
@@ -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
;
...
...
packages/unit/test/widget/fractionally_sized_box_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/gesture_detector_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/heroes_test.dart
View file @
8ac88d5a
...
...
@@ -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'
);
...
...
packages/unit/test/widget/homogeneous_viewport_test.dart
View file @
8ac88d5a
...
...
@@ -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
(
)
{
...
...
packages/unit/test/widget/init_state_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
String
>
ancestors
=
<
String
>[];
class
TestComponent
extends
StatefulComponent
{
...
...
packages/unit/test/widget/input_test.dart
View file @
8ac88d5a
...
...
@@ -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
{
...
...
packages/unit/test/widget/listener_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/mixed_viewport_test.dart
View file @
8ac88d5a
...
...
@@ -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
(
)
{
...
...
packages/unit/test/widget/multichild_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
BoxDecoration
>
expectedDecorations
)
{
MultiChildRenderObjectElement
element
=
...
...
packages/unit/test/widget/navigator_test.dart
View file @
8ac88d5a
...
...
@@ -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
(
...
...
packages/unit/test/widget/page_transitions_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
WidgetBuilder
>
get
builders
=>
<
WidgetBuilder
>[
_build
];
...
...
packages/unit/test/widget/pageable_list_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
int
>
pages
=
const
<
int
>[
0
,
1
,
2
,
3
,
4
,
5
];
int
currentPage
=
null
;
...
...
packages/unit/test/widget/parent_data_test.dart
View file @
8ac88d5a
...
...
@@ -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
});
...
...
packages/unit/test/widget/positioned_test.dart
View file @
8ac88d5a
...
...
@@ -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'
,
()
{
...
...
packages/unit/test/widget/progress_indicator_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/remember_scroll_position_test.dart
View file @
8ac88d5a
...
...
@@ -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
();
...
...
packages/unit/test/widget/render_object_widget_test.dart
View file @
8ac88d5a
...
...
@@ -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
();
...
...
packages/unit/test/widget/reparent_state_test.dart
View file @
8ac88d5a
...
...
@@ -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
);
...
...
packages/unit/test/widget/scrollable_list_hit_testing_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
int
>
items
=
const
<
int
>[
0
,
1
,
2
,
3
,
4
,
5
];
List
<
int
>
tapped
=
<
int
>[];
...
...
packages/unit/test/widget/scrollable_list_horizontal_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
int
>
items
=
const
<
int
>[
0
,
1
,
2
,
3
,
4
,
5
];
Widget
buildFrame
(
)
{
...
...
packages/unit/test/widget/scrollable_list_vertical_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
int
>
items
=
const
<
int
>[
0
,
1
,
2
,
3
,
4
,
5
];
Widget
buildFrame
(
)
{
...
...
packages/unit/test/widget/scrollable_list_with_inherited_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
int
>
items
=
<
int
>[
0
,
1
,
2
,
3
,
4
,
5
];
Widget
buildCard
(
BuildContext
context
,
int
index
)
{
...
...
packages/unit/test/widget/set_state_3_test.dart
View file @
8ac88d5a
...
...
@@ -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
{
...
...
packages/unit/test/widget/set_state_test.dart
View file @
8ac88d5a
...
...
@@ -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
();
}
...
...
packages/unit/test/widget/shader_mask_test.dart
View file @
8ac88d5a
...
...
@@ -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
,
...
...
packages/unit/test/widget/size_observer_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
packages/unit/test/widget/snack_bar_test.dart
View file @
8ac88d5a
...
...
@@ -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
...
...
packages/unit/test/widget/snap_scrolling_test.dart
View file @
8ac88d5a
...
...
@@ -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
;
...
...
packages/unit/test/widget/stack_test.dart
View file @
8ac88d5a
...
...
@@ -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
(
)
{
...
...
packages/unit/test/widget/stateful_component_test.dart
View file @
8ac88d5a
...
...
@@ -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
(
)
{
...
...
packages/unit/test/widget/stateful_components_test.dart
View file @
8ac88d5a
...
...
@@ -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
();
...
...
packages/unit/test/widget/syncing_test.dart
View file @
8ac88d5a
...
...
@@ -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
});
...
...
packages/unit/test/widget/tabs_test.dart
View file @
8ac88d5a
...
...
@@ -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
<
String
>
tabs
,
bool
isScrollable:
false
})
{
...
...
packages/unit/test/widget/test_widgets.dart
View file @
8ac88d5a
...
...
@@ -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
)
);
...
...
packages/unit/test/widget/transform_test.dart
View file @
8ac88d5a
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment