Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
flutter_boost_1.22.4
Commits
973f6e6a
Commit
973f6e6a
authored
Feb 18, 2020
by
yangwu.jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
travis tool
parent
e53e004c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
76 deletions
+76
-76
.travis.yml
.travis.yml
+1
-1
test/lib/boost_test.dart
test/lib/boost_test.dart
+1
-1
test/lib/boost_widget_test.dart
test/lib/boost_widget_test.dart
+0
-0
test/lib/unit/boost_container_test.dart
test/lib/unit/boost_container_test.dart
+74
-74
No files found.
.travis.yml
View file @
973f6e6a
...
...
@@ -12,7 +12,7 @@ before_script:
-
git clone https://github.com/flutter/flutter.git -b v1.9.1-hotfixes --depth
1
-
./flutter/bin/flutter doctor
script
:
-
./flutter/bin/flutter test
./test/lib/boost_test.dart
--coverage --coverage-path=lcov.info
-
./flutter/bin/flutter test --coverage --coverage-path=lcov.info
after_success
:
-
bash <(curl -s https://codecov.io/bash)
cache
:
...
...
test/lib/boost_test.dart
View file @
973f6e6a
import
'package:flutter_test/flutter_test.dart'
;
import
'unit/boost_channel_test.dart'
as
boost_channel
;
import
'unit/boost_container_test.dart'
as
boost_container
;
//
import 'unit/boost_container_test.dart' as boost_container;
import
'unit/boost_page_route_test.dart'
as
boost_page_route
;
...
...
test/lib/boost_widget_test.dart
deleted
100644 → 0
View file @
e53e004c
test/lib/unit/boost_container_test.dart
View file @
973f6e6a
...
...
@@ -39,7 +39,7 @@ class SecondWidgetState extends State<SecondWidget> {
typedef
ExceptionCallback
=
void
Function
(
dynamic
exception
);
class
ThirdWidget
extends
StatelessWidget
{
const
ThirdWidget
({
this
.
targetKey
,
this
.
onException
});
const
ThirdWidget
({
this
.
targetKey
,
this
.
onException
});
final
Key
targetKey
;
final
ExceptionCallback
onException
;
...
...
@@ -61,7 +61,7 @@ class ThirdWidget extends StatelessWidget {
}
class
OnTapPage
extends
StatelessWidget
{
const
OnTapPage
({
Key
key
,
this
.
id
,
this
.
onTap
})
:
super
(
key:
key
);
const
OnTapPage
({
Key
key
,
this
.
id
,
this
.
onTap
})
:
super
(
key:
key
);
final
String
id
;
final
VoidCallback
onTap
;
...
...
@@ -86,8 +86,8 @@ class OnTapPage extends StatelessWidget {
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
testWidgets
(
'Can navigator navigate to and from a stateful widget'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Can navigator navigate to and from a stateful widget'
,
(
WidgetTester
tester
)
async
{
final
Map
<
String
,
WidgetBuilder
>
routes
=
<
String
,
WidgetBuilder
>{
'/'
:
(
BuildContext
context
)
=>
FirstWidget
(),
// X
'/second'
:
(
BuildContext
context
)
=>
SecondWidget
(),
// Y
...
...
@@ -137,8 +137,8 @@ void main() {
expect
(
find
.
text
(
'Y'
,
skipOffstage:
false
),
findsNothing
);
});
//
testWidgets
(
'Navigator.of fails gracefully when not found in context'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Navigator.of fails gracefully when not found in context'
,
(
WidgetTester
tester
)
async
{
const
Key
targetKey
=
Key
(
'foo'
);
dynamic
exception
;
final
Widget
widget
=
ThirdWidget
(
...
...
@@ -154,71 +154,71 @@ void main() {
startsWith
(
'Navigator operation requested with a context'
));
});
//
testWidgets
(
'Navigator.of rootNavigator finds root Navigator'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
Column
(
children:
<
Widget
>[
const
SizedBox
(
height:
300.0
,
child:
Text
(
'Root page'
)
,
),
SizedBox
(
height:
300.0
,
child:
BoostContainer
(
onGenerateRoute:
(
RouteSettings
settings
)
{
if
(
settings
.
isInitialRoute
)
{
return
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
return
RaisedButton
(
child:
const
Text
(
'Next'
),
onPressed:
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
<
void
>
(
builder:
(
BuildContext
context
)
{
return
RaisedButton
(
child:
const
Text
(
'Inner page'
),
onPressed:
()
{
Navigator
.
of
(
context
,
rootNavigator:
true
).
push
(
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
return
const
Text
(
'Dialog'
);
}
),
);
},
);
}
),
);
},
);
},
);
}
return
null
;
},
),
),
],
),
),
));
await
tester
.
tap
(
find
.
text
(
'Next'
));
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
300
));
// Both elements are on screen.
expect
(
tester
.
getTopLeft
(
find
.
text
(
'Root page'
)).
dy
,
0.0
);
expect
(
tester
.
getTopLeft
(
find
.
text
(
'Inner page'
)).
dy
,
greaterThan
(
300.0
));
await
tester
.
tap
(
find
.
text
(
'Inner page'
));
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
300
));
// Dialog is pushed to the whole page and is at the top of the screen, not
// inside the inner page.
expect
(
tester
.
getTopLeft
(
find
.
text
(
'Dialog'
)).
dy
,
0.0
);
});
// testWidgets('Navigator.of rootNavigator finds root Navigator',
// (WidgetTester tester) async {
// await tester.pumpWidget(MaterialApp
(
// home: Material
(
// child: Column(
// children: <Widget>[
// const SizedBox(
// height: 300.0
,
// child: Text('Root page'
),
// ),
// SizedBox(
// height: 300.0,
// child: BoostContainer(
// onGenerateRoute: (RouteSettings settings
) {
// if (settings.isInitialRoute) {
// return MaterialPageRoute<void>(
// builder: (BuildContext context) {
// return RaisedButton(
// child: const Text('Next'),
// onPressed: () {
// Navigator.of(context).push
(
// MaterialPageRoute<void>(
// builder: (BuildContext context) {
// return RaisedButton(
// child: const Text('Inner page'),
// onPressed: () {
// Navigator.of(context, rootNavigator: true)
// .push(
// MaterialPageRoute<void>(
// builder: (BuildContext context) {
// return const Text('Dialog');
// }),
// );
// },
// );
// }
),
//
);
//
},
//
);
//
},
//
);
//
}
//
return null;
//
},
//
),
//
),
//
],
//
),
//
),
//
));
//
//
await tester.tap(find.text('Next'));
//
await tester.pump();
//
await tester.pump(const Duration(milliseconds: 300));
//
//
// Both elements are on screen.
//
expect(tester.getTopLeft(find.text('Root page')).dy, 0.0);
//
expect(tester.getTopLeft(find.text('Inner page')).dy, greaterThan(300.0));
//
//
await tester.tap(find.text('Inner page'));
//
await tester.pump();
//
await tester.pump(const Duration(milliseconds: 300));
//
//
// Dialog is pushed to the whole page and is at the top of the screen, not
//
// inside the inner page.
//
expect(tester.getTopLeft(find.text('Dialog')).dy, 0.0);
//
});
}
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