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
d0596582
Unverified
Commit
d0596582
authored
Aug 26, 2020
by
Dan Field
Committed by
GitHub
Aug 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests that use bogus objects, update TestImageInfo interface (#64599)
parent
c8f3df7e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
121 additions
and
110 deletions
+121
-110
bottom_tab_bar_test.dart
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
+81
-78
tab_scaffold_test.dart
...es/flutter/test/cupertino/material/tab_scaffold_test.dart
+9
-7
scaffold_test.dart
packages/flutter/test/cupertino/scaffold_test.dart
+18
-16
tab_scaffold_test.dart
packages/flutter/test/cupertino/tab_scaffold_test.dart
+10
-8
mocks_for_image_cache.dart
packages/flutter/test/painting/mocks_for_image_cache.dart
+3
-1
No files found.
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
View file @
d0596582
This diff is collapsed.
Click to expand it.
packages/flutter/test/cupertino/material/tab_scaffold_test.dart
View file @
d0596582
...
...
@@ -4,11 +4,13 @@
// @dart = 2.8
import
'dart:typed_data'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../../painting/
mocks_for_image_cache
.dart'
;
import
'../../painting/
image_data
.dart'
;
List
<
int
>
selectedTabs
;
...
...
@@ -287,7 +289,7 @@ void main() {
tabBar:
CupertinoTabBar
(
items:
List
<
BottomNavigationBarItem
>.
generate
(
10
,
(
int
i
)
=>
BottomNavigationBarItem
(
icon:
const
ImageIcon
(
TestImageProvider
(
24
,
23
)),
title:
Text
(
'
$i
'
)),
(
int
i
)
=>
BottomNavigationBarItem
(
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
Text
(
'
$i
'
)),
),
),
tabBuilder:
(
BuildContext
context
,
int
index
)
=>
const
Text
(
'content'
),
...
...
@@ -322,14 +324,14 @@ void main() {
CupertinoTabBar
_buildTabBar
(
{
int
selectedTab
=
0
})
{
return
CupertinoTabBar
(
items:
const
<
BottomNavigationBarItem
>[
items:
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 1'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 1'
),
),
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 2'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 2'
),
),
],
currentIndex:
selectedTab
,
...
...
packages/flutter/test/cupertino/scaffold_test.dart
View file @
d0596582
...
...
@@ -4,10 +4,12 @@
// @dart = 2.8
import
'dart:typed_data'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../painting/
mocks_for_image_cache
.dart'
;
import
'../painting/
image_data
.dart'
;
import
'../rendering/mock_canvas.dart'
;
/// Integration tests testing both [CupertinoPageScaffold] and [CupertinoTabScaffold].
...
...
@@ -208,14 +210,14 @@ void main() {
home:
CupertinoTabScaffold
(
tabBar:
CupertinoTabBar
(
backgroundColor:
CupertinoColors
.
white
,
items:
const
<
BottomNavigationBarItem
>[
items:
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 1'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 1'
),
),
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 2'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 2'
),
),
],
),
...
...
@@ -248,14 +250,14 @@ void main() {
),
child:
CupertinoTabScaffold
(
tabBar:
CupertinoTabBar
(
items:
const
<
BottomNavigationBarItem
>[
items:
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 1'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 1'
),
),
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 2'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 2'
),
),
],
),
...
...
@@ -298,14 +300,14 @@ void main() {
CupertinoApp
(
home:
CupertinoTabScaffold
(
tabBar:
CupertinoTabBar
(
items:
const
<
BottomNavigationBarItem
>[
items:
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 1'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 1'
),
),
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 2'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 2'
),
),
],
),
...
...
packages/flutter/test/cupertino/tab_scaffold_test.dart
View file @
d0596582
...
...
@@ -4,10 +4,12 @@
// @dart = 2.8
import
'dart:typed_data'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../painting/
mocks_for_image_cache
.dart'
;
import
'../painting/
image_data
.dart'
;
import
'../rendering/rendering_tester.dart'
;
List
<
int
>
selectedTabs
;
...
...
@@ -44,7 +46,7 @@ void main() {
BottomNavigationBarItem
tabGenerator
(
int
index
)
{
return
BottomNavigationBarItem
(
icon:
const
ImageIcon
(
TestImageProvider
(
24
,
24
)),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
Text
(
'Tab
${index + 1}
'
),
);
}
...
...
@@ -1081,7 +1083,7 @@ void main() {
tabBar:
CupertinoTabBar
(
items:
List
<
BottomNavigationBarItem
>.
generate
(
10
,
(
int
i
)
=>
BottomNavigationBarItem
(
icon:
const
ImageIcon
(
TestImageProvider
(
24
,
23
)),
title:
Text
(
'
$i
'
)),
(
int
i
)
=>
BottomNavigationBarItem
(
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
Text
(
'
$i
'
)),
),
),
tabBuilder:
(
BuildContext
context
,
int
index
)
=>
const
Text
(
'content'
),
...
...
@@ -1116,14 +1118,14 @@ void main() {
CupertinoTabBar
_buildTabBar
(
{
int
selectedTab
=
0
})
{
return
CupertinoTabBar
(
items:
const
<
BottomNavigationBarItem
>[
items:
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 1'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 1'
),
),
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 2'
),
icon:
ImageIcon
(
MemoryImage
(
Uint8List
.
fromList
(
kTransparentImage
)
)),
title:
const
Text
(
'Tab 2'
),
),
],
currentIndex:
selectedTab
,
...
...
packages/flutter/test/painting/mocks_for_image_cache.dart
View file @
d0596582
...
...
@@ -31,7 +31,9 @@ class TestImageInfo implements ImageInfo {
}
class
TestImageProvider
extends
ImageProvider
<
int
>
{
const
TestImageProvider
(
this
.
key
,
this
.
imageValue
,
{
this
.
image
});
const
TestImageProvider
(
this
.
key
,
this
.
imageValue
,
{
this
.
image
=
const
TestImage
()
})
:
assert
(
image
!=
null
);
final
int
key
;
final
int
imageValue
;
final
ui
.
Image
image
;
...
...
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