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
1e062800
Unverified
Commit
1e062800
authored
Nov 20, 2020
by
Jonah Williams
Committed by
GitHub
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[devicelab] dont use set modified for hot reload bench (#70965)
parent
c07661cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
88 deletions
+96
-88
hot_mode_tests.dart
dev/devicelab/lib/tasks/hot_mode_tests.dart
+96
-88
No files found.
dev/devicelab/lib/tasks/hot_mode_tests.dart
View file @
1e062800
...
...
@@ -19,6 +19,11 @@ const String kSourceLine = 'fontSize: (orientation == Orientation.portrait) ? 32
const
String
kReplacementLine
=
'fontSize: (orientation == Orientation.portrait) ? 34.0 : 24.0'
;
TaskFunction
createHotModeTest
(
{
String
deviceIdOverride
,
Map
<
String
,
String
>
environment
})
{
// This file is modified during the test and needs to be restored at the end.
final
File
flutterFrameworkSource
=
file
(
path
.
join
(
flutterDirectory
.
path
,
'packages/flutter/lib/src/widgets/framework.dart'
,
));
final
String
oldContents
=
flutterFrameworkSource
.
readAsStringSync
();
return
()
async
{
if
(
deviceIdOverride
==
null
)
{
final
Device
device
=
await
devices
.
workingDevice
;
...
...
@@ -42,6 +47,7 @@ TaskFunction createHotModeTest({String deviceIdOverride, Map<String, String> env
mkdirs
(
_editedFlutterGalleryDir
);
recursiveCopy
(
flutterGalleryDir
,
_editedFlutterGalleryDir
);
try
{
await
inDirectory
<
void
>(
_editedFlutterGalleryDir
,
()
async
{
smallReloadData
=
await
captureReloadData
(
options
,
environment
,
benchmarkFile
,
(
String
line
,
Process
process
)
{
if
(!
line
.
contains
(
'Reloaded '
))
{
...
...
@@ -88,10 +94,9 @@ TaskFunction createHotModeTest({String deviceIdOverride, Map<String, String> env
}
if
(
hotReloadCount
==
2
)
{
// Trigger a framework invalidation (370 libraries) without modifying the source
final
File
flutterFrameworkSource
=
file
(
path
.
join
(
flutterDirectory
.
path
,
'packages/flutter/lib/src/widgets/framework.dart'
,
));
flutterFrameworkSource
.
setLastModifiedSync
(
DateTime
.
now
());
flutterFrameworkSource
.
writeAsStringSync
(
flutterFrameworkSource
.
readAsStringSync
()
+
'
\n
'
);
process
.
stdin
.
writeln
(
'r'
);
hotReloadCount
+=
1
;
}
else
{
...
...
@@ -137,6 +142,9 @@ TaskFunction createHotModeTest({String deviceIdOverride, Map<String, String> env
json
.
decode
(
benchmarkFile
.
readAsStringSync
())
as
Map
<
String
,
dynamic
>;
}
});
}
finally
{
flutterFrameworkSource
.
writeAsStringSync
(
oldContents
);
}
});
return
TaskResult
.
success
(
...
...
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