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
3074c9e0
Unverified
Commit
3074c9e0
authored
Sep 29, 2021
by
Nicholas Shahan
Committed by
GitHub
Sep 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for web library platform defines (#90620)
parent
0167d99f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
expression_evaluation_web_test.dart
..._tools/test/web.shard/expression_evaluation_web_test.dart
+15
-0
No files found.
packages/flutter_tools/test/web.shard/expression_evaluation_web_test.dart
View file @
3074c9e0
...
...
@@ -104,6 +104,11 @@ void main() {
await
start
(
expressionEvaluation:
true
);
await
evaluateComplexExpressionsInLibrary
(
flutter
);
});
testWithoutContext
(
'evaluated expression includes web library environment defines'
,
()
async
{
await
start
(
expressionEvaluation:
true
);
await
evaluateWebLibraryBooleanFromEnvironmentInLibrary
(
flutter
);
});
});
group
(
'Flutter test for web'
,
()
{
...
...
@@ -168,6 +173,10 @@ void main() {
await
startPaused
(
expressionEvaluation:
true
);
await
evaluateComplexExpressionsInLibrary
(
flutter
);
});
testWithoutContext
(
'evaluated expression includes web library environment defines'
,
()
async
{
await
startPaused
(
expressionEvaluation:
true
);
await
evaluateWebLibraryBooleanFromEnvironmentInLibrary
(
flutter
);
});
});
}
...
...
@@ -222,6 +231,12 @@ Future<void> evaluateComplexExpressionsInLibrary(FlutterTestDriver flutter) asyn
expectInstance
(
res
,
InstanceKind
.
kDouble
,
DateTime
.
now
().
year
.
toString
());
}
Future
<
void
>
evaluateWebLibraryBooleanFromEnvironmentInLibrary
(
FlutterTestDriver
flutter
)
async
{
final
LibraryRef
library
=
await
getRootLibrary
(
flutter
);
final
ObjRef
res
=
await
flutter
.
evaluate
(
library
.
id
,
'const bool.fromEnvironment("dart.library.html")'
);
expectInstance
(
res
,
InstanceKind
.
kBool
,
true
.
toString
());
}
Future
<
LibraryRef
>
getRootLibrary
(
FlutterTestDriver
flutter
)
async
{
// `isolate.rootLib` returns incorrect library, so find the
// entrypoint manually here instead.
...
...
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