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
cb518c42
Unverified
Commit
cb518c42
authored
Oct 16, 2019
by
Jonah Williams
Committed by
GitHub
Oct 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix progress indicators for release/profile builds of web. (#42857)
parent
01f779e9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
66 deletions
+79
-66
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+8
-4
web.dart
packages/flutter_tools/lib/src/build_system/targets/web.dart
+0
-1
resident_web_runner_cold_test.dart
...ols/test/general.shard/resident_web_runner_cold_test.dart
+10
-0
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+0
-61
testbed.dart
packages/flutter_tools/test/src/testbed.dart
+61
-0
No files found.
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
cb518c42
...
...
@@ -183,12 +183,14 @@ class ResidentWebRunner extends ResidentRunner {
);
// When connecting to a browser, update the message with a seemsSlow notification
// to handle the case where we fail to connect.
if
(
debuggingOptions
.
browserLaunch
)
{
buildStatus
.
stop
();
statusActive
=
false
;
if
(
debuggingOptions
.
browserLaunch
&&
supportsServiceProtocol
)
{
buildStatus
=
logger
.
startProgress
(
'Attempting to connect to browser instance..'
,
timeout:
const
Duration
(
seconds:
30
),
);
statusActive
=
true
;
}
await
device
.
startApp
(
package
,
mainPath:
target
,
...
...
@@ -201,8 +203,10 @@ class ResidentWebRunner extends ResidentRunner {
_connectionResult
=
await
_webFs
.
connect
(
debuggingOptions
);
unawaited
(
_connectionResult
.
debugConnection
.
onDone
.
whenComplete
(()
=>
exit
(
0
)));
}
if
(
statusActive
)
{
buildStatus
.
stop
();
statusActive
=
false
;
}
appStartedCompleter
?.
complete
();
return
attach
(
connectionInfoCompleter:
connectionInfoCompleter
,
...
...
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
cb518c42
...
...
@@ -112,7 +112,6 @@ class Dart2JSTarget extends Target {
Source
.
artifact
(
Artifact
.
flutterWebSdk
),
Source
.
artifact
(
Artifact
.
dart2jsSnapshot
),
Source
.
artifact
(
Artifact
.
engineDartBinary
),
Source
.
artifact
(
Artifact
.
engineDartSdkPath
),
Source
.
pattern
(
'{BUILD_DIR}/main.dart'
),
Source
.
pattern
(
'{PROJECT_DIR}/.packages'
),
Source
.
function
(
listDartSources
),
// <- every dart file under {PROJECT_DIR}/lib and in .packages
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart
View file @
cb518c42
...
...
@@ -7,8 +7,10 @@ import 'dart:async';
import
'package:dwds/dwds.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/resident_runner.dart'
;
import
'package:flutter_tools/src/build_runner/resident_web_runner.dart'
;
...
...
@@ -62,6 +64,9 @@ void main() {
test
(
'Can successfully run and connect without vmservice'
,
()
=>
testbed
.
run
(()
async
{
_setupMocks
();
final
DelegateLogger
delegateLogger
=
logger
;
final
MockStatus
mockStatus
=
MockStatus
();
delegateLogger
.
status
=
mockStatus
;
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
...
...
@@ -69,6 +74,9 @@ void main() {
final
DebugConnectionInfo
debugConnectionInfo
=
await
connectionInfoCompleter
.
future
;
expect
(
debugConnectionInfo
.
wsUri
,
null
);
verify
(
mockStatus
.
stop
()).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
DelegateLogger
(
BufferLogger
()),
}));
test
(
'Can full restart after attaching'
,
()
=>
testbed
.
run
(()
async
{
...
...
@@ -109,3 +117,5 @@ class MockBuildDaemonCreator extends Mock implements BuildDaemonCreator {}
class
MockFlutterWebFs
extends
Mock
implements
WebFs
{}
class
MockDebugConnection
extends
Mock
implements
DebugConnection
{}
class
MockVmService
extends
Mock
implements
VmService
{}
class
MockStatus
extends
Mock
implements
Status
{}
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
cb518c42
...
...
@@ -10,7 +10,6 @@ import 'package:flutter_tools/src/base/common.dart';
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
...
...
@@ -563,63 +562,3 @@ class MockDebugConnection extends Mock implements DebugConnection {}
class
MockAppConnection
extends
Mock
implements
AppConnection
{}
class
MockVmService
extends
Mock
implements
VmService
{}
class
MockStatus
extends
Mock
implements
Status
{}
class
DelegateLogger
implements
Logger
{
DelegateLogger
(
this
.
delegate
);
final
Logger
delegate
;
Status
status
;
@override
bool
get
quiet
=>
delegate
.
quiet
;
@override
set
quiet
(
bool
value
)
=>
delegate
.
quiet
;
@override
bool
get
hasTerminal
=>
delegate
.
hasTerminal
;
@override
bool
get
isVerbose
=>
delegate
.
isVerbose
;
@override
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis
,
TerminalColor
color
,
int
indent
,
int
hangingIndent
,
bool
wrap
})
{
delegate
.
printError
(
message
,
stackTrace:
stackTrace
,
emphasis:
emphasis
,
color:
color
,
indent:
indent
,
hangingIndent:
hangingIndent
,
wrap:
wrap
,
);
}
@override
void
printStatus
(
String
message
,
{
bool
emphasis
,
TerminalColor
color
,
bool
newline
,
int
indent
,
int
hangingIndent
,
bool
wrap
})
{
delegate
.
printStatus
(
message
,
emphasis:
emphasis
,
color:
color
,
indent:
indent
,
hangingIndent:
hangingIndent
,
wrap:
wrap
,
);
}
@override
void
printTrace
(
String
message
)
{
delegate
.
printTrace
(
message
);
}
@override
void
sendNotification
(
String
message
,
{
String
progressId
})
{
delegate
.
sendNotification
(
message
,
progressId:
progressId
);
}
@override
Status
startProgress
(
String
message
,
{
Duration
timeout
,
String
progressId
,
bool
multilineOutput
=
false
,
int
progressIndicatorPadding
=
kDefaultStatusPadding
})
{
return
status
;
}
@override
bool
get
supportsColor
=>
delegate
.
supportsColor
;
}
packages/flutter_tools/test/src/testbed.dart
View file @
cb518c42
...
...
@@ -734,3 +734,64 @@ class TestFeatureFlags implements FeatureFlags {
return
false
;
}
}
class
DelegateLogger
implements
Logger
{
DelegateLogger
(
this
.
delegate
);
final
Logger
delegate
;
Status
status
;
@override
bool
get
quiet
=>
delegate
.
quiet
;
@override
set
quiet
(
bool
value
)
=>
delegate
.
quiet
;
@override
bool
get
hasTerminal
=>
delegate
.
hasTerminal
;
@override
bool
get
isVerbose
=>
delegate
.
isVerbose
;
@override
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis
,
TerminalColor
color
,
int
indent
,
int
hangingIndent
,
bool
wrap
})
{
delegate
.
printError
(
message
,
stackTrace:
stackTrace
,
emphasis:
emphasis
,
color:
color
,
indent:
indent
,
hangingIndent:
hangingIndent
,
wrap:
wrap
,
);
}
@override
void
printStatus
(
String
message
,
{
bool
emphasis
,
TerminalColor
color
,
bool
newline
,
int
indent
,
int
hangingIndent
,
bool
wrap
})
{
delegate
.
printStatus
(
message
,
emphasis:
emphasis
,
color:
color
,
indent:
indent
,
hangingIndent:
hangingIndent
,
wrap:
wrap
,
);
}
@override
void
printTrace
(
String
message
)
{
delegate
.
printTrace
(
message
);
}
@override
void
sendNotification
(
String
message
,
{
String
progressId
})
{
delegate
.
sendNotification
(
message
,
progressId:
progressId
);
}
@override
Status
startProgress
(
String
message
,
{
Duration
timeout
,
String
progressId
,
bool
multilineOutput
=
false
,
int
progressIndicatorPadding
=
kDefaultStatusPadding
})
{
return
status
;
}
@override
bool
get
supportsColor
=>
delegate
.
supportsColor
;
}
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