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
25c10d6a
Unverified
Commit
25c10d6a
authored
May 14, 2021
by
Jenn Magder
Committed by
GitHub
May 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace testUsingContext with testWithoutContext in a few places (#82498)
parent
c533ab65
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
90 deletions
+79
-90
desktop_device_test.dart
...flutter_tools/test/general.shard/desktop_device_test.dart
+2
-2
device_port_forwarder_test.dart
..._tools/test/general.shard/device_port_forwarder_test.dart
+2
-5
generate_localizations_test.dart
...tools/test/general.shard/generate_localizations_test.dart
+63
-66
macos_device_test.dart
...ter_tools/test/general.shard/macos/macos_device_test.dart
+3
-3
analyze_size_test.dart
...utter_tools/test/integration.shard/analyze_size_test.dart
+1
-2
downgrade_upgrade_integration_test.dart
...integration.shard/downgrade_upgrade_integration_test.dart
+1
-2
gradle_non_android_plugin_test.dart
...est/integration.shard/gradle_non_android_plugin_test.dart
+1
-2
observatory_port_test.dart
...r_tools/test/integration.shard/observatory_port_test.dart
+3
-4
tool_backend_test.dart
...utter_tools/test/integration.shard/tool_backend_test.dart
+3
-4
No files found.
packages/flutter_tools/test/general.shard/desktop_device_test.dart
View file @
25c10d6a
...
@@ -22,7 +22,7 @@ import 'package:meta/meta.dart';
...
@@ -22,7 +22,7 @@ import 'package:meta/meta.dart';
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/
context
.dart'
;
import
'../src/
fake_process_manager
.dart'
;
void
main
(
)
{
void
main
(
)
{
group
(
'Basic info'
,
()
{
group
(
'Basic info'
,
()
{
...
@@ -244,7 +244,7 @@ void main() {
...
@@ -244,7 +244,7 @@ void main() {
expect
(
portForwarder
.
forwardedPorts
.
isEmpty
,
true
);
expect
(
portForwarder
.
forwardedPorts
.
isEmpty
,
true
);
});
});
test
Using
Context
(
'createDevFSWriter returns a LocalDevFSWriter'
,
()
{
test
Without
Context
(
'createDevFSWriter returns a LocalDevFSWriter'
,
()
{
final
FakeDesktopDevice
device
=
setUpDesktopDevice
();
final
FakeDesktopDevice
device
=
setUpDesktopDevice
();
expect
(
device
.
createDevFSWriter
(
null
,
''
),
isA
<
LocalDevFSWriter
>());
expect
(
device
.
createDevFSWriter
(
null
,
''
),
isA
<
LocalDevFSWriter
>());
...
...
packages/flutter_tools/test/general.shard/device_port_forwarder_test.dart
View file @
25c10d6a
...
@@ -2,24 +2,21 @@
...
@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:io'
as
io
;
// ignore: dart_io_import
import
'dart:io'
as
io
;
// ignore: dart_io_import
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/device_port_forwarder.dart'
;
import
'package:flutter_tools/src/device_port_forwarder.dart'
;
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
void
main
(
)
{
void
main
(
)
{
test
Using
Context
(
'dispose does not throw exception if no process is present'
,
()
{
test
Without
Context
(
'dispose does not throw exception if no process is present'
,
()
{
final
ForwardedPort
forwardedPort
=
ForwardedPort
(
123
,
456
);
final
ForwardedPort
forwardedPort
=
ForwardedPort
(
123
,
456
);
expect
(
forwardedPort
.
context
,
isNull
);
expect
(
forwardedPort
.
context
,
isNull
);
forwardedPort
.
dispose
();
forwardedPort
.
dispose
();
});
});
test
Using
Context
(
'dispose kills process if process was available'
,
()
{
test
Without
Context
(
'dispose kills process if process was available'
,
()
{
final
FakeProcess
process
=
FakeProcess
();
final
FakeProcess
process
=
FakeProcess
();
final
ForwardedPort
forwardedPort
=
ForwardedPort
.
withContext
(
123
,
456
,
process
);
final
ForwardedPort
forwardedPort
=
ForwardedPort
.
withContext
(
123
,
456
,
process
);
forwardedPort
.
dispose
();
forwardedPort
.
dispose
();
...
...
packages/flutter_tools/test/general.shard/generate_localizations_test.dart
View file @
25c10d6a
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/general.shard/macos/macos_device_test.dart
View file @
25c10d6a
...
@@ -20,7 +20,7 @@ import 'package:flutter_tools/src/project.dart';
...
@@ -20,7 +20,7 @@ import 'package:flutter_tools/src/project.dart';
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/
context
.dart'
;
import
'../../src/
fake_process_manager
.dart'
;
import
'../../src/fakes.dart'
;
import
'../../src/fakes.dart'
;
final
FakePlatform
macOS
=
FakePlatform
(
final
FakePlatform
macOS
=
FakePlatform
(
...
@@ -196,7 +196,7 @@ void main() {
...
@@ -196,7 +196,7 @@ void main() {
expect
(
await
device
.
targetPlatformDisplayName
,
'darwin-arm64'
);
expect
(
await
device
.
targetPlatformDisplayName
,
'darwin-arm64'
);
});
});
test
Using
Context
(
'isSupportedForProject is false with no host app'
,
()
async
{
test
Without
Context
(
'isSupportedForProject is false with no host app'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
MacOSDevice
device
=
MacOSDevice
(
final
MacOSDevice
device
=
MacOSDevice
(
fileSystem:
fileSystem
,
fileSystem:
fileSystem
,
...
@@ -211,7 +211,7 @@ void main() {
...
@@ -211,7 +211,7 @@ void main() {
expect
(
device
.
isSupportedForProject
(
flutterProject
),
false
);
expect
(
device
.
isSupportedForProject
(
flutterProject
),
false
);
});
});
test
Using
Context
(
'executablePathForDevice uses the correct package executable'
,
()
async
{
test
Without
Context
(
'executablePathForDevice uses the correct package executable'
,
()
async
{
final
FakeMacOSApp
package
=
FakeMacOSApp
();
final
FakeMacOSApp
package
=
FakeMacOSApp
();
final
MacOSDevice
device
=
MacOSDevice
(
final
MacOSDevice
device
=
MacOSDevice
(
fileSystem:
MemoryFileSystem
.
test
(),
fileSystem:
MemoryFileSystem
.
test
(),
...
...
packages/flutter_tools/test/integration.shard/analyze_size_test.dart
View file @
25c10d6a
...
@@ -9,7 +9,6 @@ import 'package:file_testing/file_testing.dart';
...
@@ -9,7 +9,6 @@ import 'package:file_testing/file_testing.dart';
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'test_utils.dart'
;
import
'test_utils.dart'
;
const
String
apkDebugMessage
=
'A summary of your APK analysis can be found at: '
;
const
String
apkDebugMessage
=
'A summary of your APK analysis can be found at: '
;
...
@@ -17,7 +16,7 @@ const String iosDebugMessage = 'A summary of your iOS bundle analysis can be fou
...
@@ -17,7 +16,7 @@ const String iosDebugMessage = 'A summary of your iOS bundle analysis can be fou
const
String
runDevToolsMessage
=
'flutter pub global activate devtools; flutter pub global run devtools '
;
const
String
runDevToolsMessage
=
'flutter pub global activate devtools; flutter pub global run devtools '
;
void
main
(
)
{
void
main
(
)
{
test
Using
Context
(
'--analyze-size flag produces expected output on hello_world for Android'
,
()
async
{
test
Without
Context
(
'--analyze-size flag produces expected output on hello_world for Android'
,
()
async
{
final
String
workingDirectory
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'examples'
,
'hello_world'
);
final
String
workingDirectory
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'examples'
,
'hello_world'
);
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
...
...
packages/flutter_tools/test/integration.shard/downgrade_upgrade_integration_test.dart
View file @
25c10d6a
...
@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/base/process.dart';
...
@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/base/process.dart';
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'test_utils.dart'
;
import
'test_utils.dart'
;
const
String
_kInitialVersion
=
'v1.9.1'
;
const
String
_kInitialVersion
=
'v1.9.1'
;
...
@@ -46,7 +45,7 @@ void main() {
...
@@ -46,7 +45,7 @@ void main() {
}
}
});
});
test
Using
Context
(
'Can upgrade and downgrade a Flutter checkout'
,
()
async
{
test
Without
Context
(
'Can upgrade and downgrade a Flutter checkout'
,
()
async
{
final
Directory
testDirectory
=
parentDirectory
.
childDirectory
(
'flutter'
);
final
Directory
testDirectory
=
parentDirectory
.
childDirectory
(
'flutter'
);
testDirectory
.
createSync
(
recursive:
true
);
testDirectory
.
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/test/integration.shard/gradle_non_android_plugin_test.dart
View file @
25c10d6a
...
@@ -8,7 +8,6 @@ import 'package:file/file.dart';
...
@@ -8,7 +8,6 @@ import 'package:file/file.dart';
import
'package:file_testing/file_testing.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'test_utils.dart'
;
import
'test_utils.dart'
;
void
main
(
)
{
void
main
(
)
{
...
@@ -22,7 +21,7 @@ void main() {
...
@@ -22,7 +21,7 @@ void main() {
tryToDelete
(
tempDir
);
tryToDelete
(
tempDir
);
});
});
test
Using
Context
(
'flutter app that depends on a non-Android plugin can still build for Android'
,
()
{
test
Without
Context
(
'flutter app that depends on a non-Android plugin can still build for Android'
,
()
{
final
String
flutterRoot
=
getFlutterRoot
();
final
String
flutterRoot
=
getFlutterRoot
();
final
String
flutterBin
=
fileSystem
.
path
.
join
(
final
String
flutterBin
=
fileSystem
.
path
.
join
(
flutterRoot
,
flutterRoot
,
...
...
packages/flutter_tools/test/integration.shard/observatory_port_test.dart
View file @
25c10d6a
...
@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/base/io.dart';
...
@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/base/io.dart';
import
'package:flutter_tools/src/convert.dart'
;
import
'package:flutter_tools/src/convert.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'test_data/basic_project.dart'
;
import
'test_data/basic_project.dart'
;
import
'test_utils.dart'
;
import
'test_utils.dart'
;
...
@@ -56,7 +55,7 @@ void main() {
...
@@ -56,7 +55,7 @@ void main() {
tryToDelete
(
tempDir
);
tryToDelete
(
tempDir
);
});
});
test
Using
Context
(
'flutter run --observatory-port'
,
()
async
{
test
Without
Context
(
'flutter run --observatory-port'
,
()
async
{
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
int
port
=
await
getFreePort
();
final
int
port
=
await
getFreePort
();
// If only --observatory-port is provided, --observatory-port will be used by DDS
// If only --observatory-port is provided, --observatory-port will be used by DDS
...
@@ -74,7 +73,7 @@ void main() {
...
@@ -74,7 +73,7 @@ void main() {
await
process
.
exitCode
;
await
process
.
exitCode
;
});
});
test
Using
Context
(
'flutter run --dds-port --observatory-port'
,
()
async
{
test
Without
Context
(
'flutter run --dds-port --observatory-port'
,
()
async
{
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
int
observatoryPort
=
await
getFreePort
();
final
int
observatoryPort
=
await
getFreePort
();
int
ddsPort
=
await
getFreePort
();
int
ddsPort
=
await
getFreePort
();
...
@@ -97,7 +96,7 @@ void main() {
...
@@ -97,7 +96,7 @@ void main() {
await
process
.
exitCode
;
await
process
.
exitCode
;
});
});
test
Using
Context
(
'flutter run --dds-port'
,
()
async
{
test
Without
Context
(
'flutter run --dds-port'
,
()
async
{
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
final
int
ddsPort
=
await
getFreePort
();
final
int
ddsPort
=
await
getFreePort
();
// If only --dds-port is provided, --dds-port will be used by DDS and the VM service
// If only --dds-port is provided, --dds-port will be used by DDS and the VM service
...
...
packages/flutter_tools/test/integration.shard/tool_backend_test.dart
View file @
25c10d6a
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'test_utils.dart'
;
import
'test_utils.dart'
;
final
String
toolBackend
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'packages'
,
'flutter_tools'
,
'bin'
,
'tool_backend.dart'
);
final
String
toolBackend
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'packages'
,
'flutter_tools'
,
'bin'
,
'tool_backend.dart'
);
...
@@ -15,7 +14,7 @@ final String examplePath = fileSystem.path.join(getFlutterRoot(), 'examples', 'h
...
@@ -15,7 +14,7 @@ final String examplePath = fileSystem.path.join(getFlutterRoot(), 'examples', 'h
final
String
dart
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
platform
.
isWindows
?
'dart.bat'
:
'dart'
);
final
String
dart
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
platform
.
isWindows
?
'dart.bat'
:
'dart'
);
void
main
(
)
{
void
main
(
)
{
test
Using
Context
(
'tool_backend.dart exits if PROJECT_DIR is not set'
,
()
async
{
test
Without
Context
(
'tool_backend.dart exits if PROJECT_DIR is not set'
,
()
async
{
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
dart
,
dart
,
toolBackend
,
toolBackend
,
...
@@ -27,7 +26,7 @@ void main() {
...
@@ -27,7 +26,7 @@ void main() {
expect
(
result
.
stderr
,
contains
(
'PROJECT_DIR environment variable must be set to the location of Flutter project to be built.'
));
expect
(
result
.
stderr
,
contains
(
'PROJECT_DIR environment variable must be set to the location of Flutter project to be built.'
));
});
});
test
Using
Context
(
'tool_backend.dart exits if FLUTTER_ROOT is not set'
,
()
async
{
test
Without
Context
(
'tool_backend.dart exits if FLUTTER_ROOT is not set'
,
()
async
{
// Removing parent environment means that batch script cannot be run.
// Removing parent environment means that batch script cannot be run.
final
String
dart
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
platform
.
isWindows
?
'dart.exe'
:
'dart'
);
final
String
dart
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
platform
.
isWindows
?
'dart.exe'
:
'dart'
);
...
@@ -44,7 +43,7 @@ void main() {
...
@@ -44,7 +43,7 @@ void main() {
expect
(
result
.
stderr
,
contains
(
'FLUTTER_ROOT environment variable must be set to the location of the Flutter SDK.'
));
expect
(
result
.
stderr
,
contains
(
'FLUTTER_ROOT environment variable must be set to the location of the Flutter SDK.'
));
});
});
test
Using
Context
(
'tool_backend.dart exits if local engine does not match build mode'
,
()
async
{
test
Without
Context
(
'tool_backend.dart exits if local engine does not match build mode'
,
()
async
{
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
dart
,
dart
,
toolBackend
,
toolBackend
,
...
...
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