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
ad7e2f7b
Unverified
Commit
ad7e2f7b
authored
Mar 31, 2023
by
Dan Field
Committed by
GitHub
Mar 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable Fuchsia SDK usage unless opted in (#123084)
Disable Fuchsia SDK usage unless opted in
parent
20de2a28
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
fuchsia_sdk.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
+2
-1
fuchsia_device_test.dart
...tools/test/general.shard/fuchsia/fuchsia_device_test.dart
+8
-0
fuchsia_ffx_test.dart
...er_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart
+20
-1
No files found.
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
View file @
ad7e2f7b
...
...
@@ -8,6 +8,7 @@ import '../base/file_system.dart';
import
'../base/io.dart'
;
import
'../base/platform.dart'
;
import
'../convert.dart'
;
import
'../features.dart'
show
featureFlags
;
import
'../globals.dart'
as
globals
;
import
'fuchsia_ffx.dart'
;
...
...
@@ -16,7 +17,7 @@ import 'fuchsia_pm.dart';
/// Returns [true] if the current platform supports Fuchsia targets.
bool
isFuchsiaSupportedPlatform
(
Platform
platform
)
{
return
platform
.
isLinux
||
platform
.
isMacOS
;
return
featureFlags
.
isFuchsiaEnabled
&&
(
platform
.
isLinux
||
platform
.
isMacOS
)
;
}
/// The Fuchsia SDK shell commands.
...
...
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart
View file @
ad7e2f7b
...
...
@@ -17,6 +17,7 @@ import 'package:flutter_tools/src/build_info.dart';
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/device_port_forwarder.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_device.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_ffx.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_kernel_compiler.dart'
;
...
...
@@ -32,6 +33,7 @@ import 'package:vm_service/vm_service.dart' as vm_service;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/fake_vm_services.dart'
;
import
'../../src/fakes.dart'
;
final
vm_service
.
Isolate
fakeIsolate
=
vm_service
.
Isolate
(
id:
'1'
,
...
...
@@ -483,6 +485,7 @@ void main() {
expect
(
device
.
supportsScreenshot
,
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
FakePlatform
(),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
testUsingContext
(
'is not supported on Windows'
,
()
{
...
...
@@ -493,6 +496,7 @@ void main() {
Platform:
()
=>
FakePlatform
(
operatingSystem:
'windows'
,
),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
test
(
"takeScreenshot throws if file isn't .ppm"
,
()
async
{
...
...
@@ -532,6 +536,7 @@ void main() {
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
},
),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
testUsingContext
(
'takeScreenshot throws if scp failed'
,
()
async
{
...
...
@@ -582,6 +587,7 @@ void main() {
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
},
),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
testUsingContext
(
...
...
@@ -632,6 +638,7 @@ void main() {
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
},
),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
},
testOn:
'posix'
);
testUsingContext
(
'takeScreenshot returns'
,
()
async
{
...
...
@@ -674,6 +681,7 @@ void main() {
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
},
),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
});
...
...
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart
View file @
ad7e2f7b
...
...
@@ -6,12 +6,15 @@ import 'package:file/file.dart';
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_ffx.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
import
'../../src/fake_process_manager.dart'
;
import
'../../src/context.dart'
;
import
'../../src/fakes.dart'
;
void
main
(
)
{
late
FakeFuchsiaArtifacts
fakeFuchsiaArtifacts
;
...
...
@@ -27,6 +30,22 @@ void main() {
fakeFuchsiaArtifacts
.
ffx
=
ffx
;
});
testUsingContext
(
'isFuchsiaSupportedPlatform returns true when opted in on Linux and macOS'
,
()
{
expect
(
isFuchsiaSupportedPlatform
(
FakePlatform
(
operatingSystem:
'macos'
)),
true
);
expect
(
isFuchsiaSupportedPlatform
(
FakePlatform
()),
true
);
expect
(
isFuchsiaSupportedPlatform
(
FakePlatform
(
operatingSystem:
'windows'
)),
false
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
testUsingContext
(
'isFuchsiaSupportedPlatform returns false when opted out on Linux and macOS'
,
()
{
expect
(
isFuchsiaSupportedPlatform
(
FakePlatform
(
operatingSystem:
'macos'
)),
false
);
expect
(
isFuchsiaSupportedPlatform
(
FakePlatform
()),
false
);
expect
(
isFuchsiaSupportedPlatform
(
FakePlatform
(
operatingSystem:
'windows'
)),
false
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(),
});
group
(
'ffx list'
,
()
{
testWithoutContext
(
'ffx not found'
,
()
{
final
FuchsiaFfx
fuchsiaFfx
=
FuchsiaFfx
(
...
...
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