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
6ad807e3
Unverified
Commit
6ad807e3
authored
Mar 06, 2020
by
Dan Field
Committed by
GitHub
Mar 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More fixes for randomizing test order (#52060)
parent
a68f96ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
15 deletions
+21
-15
application_package_test.dart
...er_tools/test/general.shard/application_package_test.dart
+5
-1
plugins_test.dart
packages/flutter_tools/test/general.shard/plugins_test.dart
+16
-14
No files found.
packages/flutter_tools/test/general.shard/application_package_test.dart
View file @
6ad807e3
...
...
@@ -206,7 +206,7 @@ void main() {
});
group
(
'PrebuiltIOSApp'
,
()
{
final
MockOperatingSystemUtils
os
=
MockOperatingSystemUtils
()
;
MockOperatingSystemUtils
os
;
final
Map
<
Type
,
Generator
>
overrides
=
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -215,6 +215,10 @@ void main() {
OperatingSystemUtils:
()
=>
os
,
};
setUp
(()
{
os
=
MockOperatingSystemUtils
();
});
testUsingContext
(
'Error on non-existing file'
,
()
{
final
PrebuiltIOSApp
iosApp
=
IOSApp
.
fromPrebuiltApp
(
globals
.
fs
.
file
(
'not_existing.ipa'
))
as
PrebuiltIOSApp
;
...
...
packages/flutter_tools/test/general.shard/plugins_test.dart
View file @
6ad807e3
...
...
@@ -159,7 +159,7 @@ flutter:
);
}
void
createPluginWithInvalidAndroidPackage
()
{
Directory
createPluginWithInvalidAndroidPackage
()
{
final
Directory
pluginUsingJavaAndNewEmbeddingDir
=
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_plugin_invalid_package.'
);
pluginUsingJavaAndNewEmbeddingDir
...
...
@@ -187,6 +187,7 @@ flutter:
'plugin1:
${pluginUsingJavaAndNewEmbeddingDir.childDirectory('lib').uri.toString()}
\n
'
,
mode:
FileMode
.
append
,
);
return
pluginUsingJavaAndNewEmbeddingDir
;
}
void
createNewKotlinPlugin2
()
{
...
...
@@ -279,7 +280,7 @@ flutter:
);
}
void
createPluginWithDependencies
({
Directory
createPluginWithDependencies
({
@required
String
name
,
@required
List
<
String
>
dependencies
,
})
{
...
...
@@ -308,6 +309,7 @@ dependencies:
'
$name
:
${pluginDirectory.childDirectory('lib').uri.toString()}
\n
'
,
mode:
FileMode
.
append
,
);
return
pluginDirectory
;
}
// Creates the files that would indicate that pod install has run for the
...
...
@@ -389,9 +391,9 @@ EndGlobal''');
});
testUsingContext('
Refreshing
the
plugin
list
modifies
.
flutter
-
plugins
and
.
flutter
-
plugins
-
dependencies
when
there
are
plugins
', () {
createPluginWithDependencies(name: '
plugin
-
a
', dependencies: const <String>['
plugin
-
b
', '
plugin
-
c
', '
random
-
package
']);
createPluginWithDependencies(name: '
plugin
-
b
', dependencies: const <String>['
plugin
-
c
']);
createPluginWithDependencies(name: '
plugin
-
c
', dependencies: const <String>[]);
final Directory pluginA =
createPluginWithDependencies(name: '
plugin
-
a
', dependencies: const <String>['
plugin
-
b
', '
plugin
-
c
', '
random
-
package
']);
final Directory pluginB =
createPluginWithDependencies(name: '
plugin
-
b
', dependencies: const <String>['
plugin
-
c
']);
final Directory pluginC =
createPluginWithDependencies(name: '
plugin
-
c
', dependencies: const <String>[]);
when(iosProject.existsSync()).thenReturn(true);
final DateTime dateCreated = DateTime(1970, 1, 1);
...
...
@@ -410,9 +412,9 @@ EndGlobal''');
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), true);
expect(flutterProject.flutterPluginsFile.readAsStringSync(),
'
#
This
is
a
generated
file
;
do
not
edit
or
check
into
version
control
.
\
n
'
'
plugin
-
a
=
/.
tmp_rand0
/
plugin
.
rand0
/
\
n
'
'
plugin
-
b
=
/.
tmp_rand0
/
plugin
.
rand1
/
\
n
'
'
plugin
-
c
=
/.
tmp_rand0
/
plugin
.
rand2
/
\
n
'
'
plugin
-
a
=
$
{
pluginA
.
path
}
/
\
n
'
'
plugin
-
b
=
$
{
pluginB
.
path
}
/
\
n
'
'
plugin
-
c
=
$
{
pluginC
.
path
}
/
\
n
'
''
);
...
...
@@ -424,7 +426,7 @@ EndGlobal''');
final List<dynamic> expectedPlugins = <dynamic>[
<String, dynamic> {
'
name
': '
plugin
-
a
',
'
path
': '
/.
tmp_rand0
/
plugin
.
rand0
/
',
'
path
': '
$
{
pluginA
.
path
}
/
',
'
dependencies
': <String>[
'
plugin
-
b
',
'
plugin
-
c
'
...
...
@@ -432,14 +434,14 @@ EndGlobal''');
},
<String, dynamic> {
'
name
': '
plugin
-
b
',
'
path
': '
/.
tmp_rand0
/
plugin
.
rand1
/
',
'
path
': '
$
{
pluginB
.
path
}
/
',
'
dependencies
': <String>[
'
plugin
-
c
'
]
},
<String, dynamic> {
'
name
': '
plugin
-
c
',
'
path
': '
/.
tmp_rand0
/
plugin
.
rand2
/
',
'
path
': '
$
{
pluginC
.
path
}
/
',
'
dependencies
': <String>[]
},
];
...
...
@@ -642,7 +644,7 @@ EndGlobal''');
when
(
flutterProject
.
isModule
).
thenReturn
(
false
);
when
(
androidProject
.
getEmbeddingVersion
()).
thenReturn
(
AndroidEmbeddingVersion
.
v1
);
createPluginWithInvalidAndroidPackage
();
final
Directory
pluginDir
=
createPluginWithInvalidAndroidPackage
();
await
expectLater
(
()
async
{
...
...
@@ -650,8 +652,8 @@ EndGlobal''');
},
throwsToolExit
(
message:
"The plugin `plugin1` doesn't have a main class defined in "
'
/.tmp_rand2/flutter_plugin_invalid_package.rand2
/android/src/main/java/plugin1/invalid/UseNewEmbedding.java or '
'
/.tmp_rand2/flutter_plugin_invalid_package.rand2
/android/src/main/kotlin/plugin1/invalid/UseNewEmbedding.kt. '
'
${pluginDir.path}
/android/src/main/java/plugin1/invalid/UseNewEmbedding.java or '
'
${pluginDir.path}
/android/src/main/kotlin/plugin1/invalid/UseNewEmbedding.kt. '
"This is likely to due to an incorrect `androidPackage: plugin1.invalid` or `mainClass` entry in the plugin's pubspec.yaml.
\n
"
'If you are the author of this plugin, fix the `androidPackage` entry or move the main class to any of locations used above. '
'Otherwise, please contact the author of this plugin and consider using a different plugin in the meanwhile.'
,
...
...
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