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
42a14b58
Unverified
Commit
42a14b58
authored
Jun 07, 2019
by
Jonah Williams
Committed by
GitHub
Jun 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compatibility pass on flutter/foundation tests for JavaScript compilation. (1) (#33349)
parent
03872b63
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
3 deletions
+24
-3
bit_field_test.dart
packages/flutter/test/foundation/bit_field_test.dart
+2
-0
consolidate_response_test.dart
...es/flutter/test/foundation/consolidate_response_test.dart
+2
-0
error_reporting_test.dart
packages/flutter/test/foundation/error_reporting_test.dart
+2
-0
isolates_test.dart
packages/flutter/test/foundation/isolates_test.dart
+2
-0
serialization_test.dart
packages/flutter/test/foundation/serialization_test.dart
+2
-0
service_extensions_test.dart
...ages/flutter/test/foundation/service_extensions_test.dart
+2
-0
stack_trace_test.dart
packages/flutter/test/foundation/stack_trace_test.dart
+2
-0
binding.dart
packages/flutter_test/lib/src/binding.dart
+10
-3
No files found.
packages/flutter/test/foundation/bit_field_test.dart
View file @
42a14b58
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'package:flutter/foundation.dart'
;
import
'../flutter_test_alternative.dart'
;
...
...
packages/flutter/test/foundation/consolidate_response_test.dart
View file @
42a14b58
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'dart:async'
;
import
'dart:io'
;
...
...
packages/flutter/test/foundation/error_reporting_test.dart
View file @
42a14b58
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
// web has different stack traces
import
'dart:async'
;
import
'package:flutter/foundation.dart'
;
...
...
packages/flutter/test/foundation/isolates_test.dart
View file @
42a14b58
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
// isolates not supported on the web.
import
'package:flutter/foundation.dart'
;
import
'../flutter_test_alternative.dart'
;
...
...
packages/flutter/test/foundation/serialization_test.dart
View file @
42a14b58
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
// web does not support certain 64bit behavior
import
'dart:typed_data'
;
import
'package:flutter/foundation.dart'
;
...
...
packages/flutter/test/foundation/service_extensions_test.dart
View file @
42a14b58
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:typed_data'
;
...
...
packages/flutter/test/foundation/stack_trace_test.dart
View file @
42a14b58
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
// web has different stack traces
import
'package:flutter/foundation.dart'
;
import
'../flutter_test_alternative.dart'
;
...
...
packages/flutter_test/lib/src/binding.dart
View file @
42a14b58
...
...
@@ -23,6 +23,7 @@ import 'package:stack_trace/stack_trace.dart' as stack_trace;
import
'package:vector_math/vector_math_64.dart'
;
import
'goldens.dart'
;
import
'platform.dart'
;
import
'stack_manipulation.dart'
;
import
'test_async_utils.dart'
;
import
'test_exception_reporter.dart'
;
...
...
@@ -151,7 +152,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
/// environment variables for a variable called `FLUTTER_TEST`.)
static
WidgetsBinding
ensureInitialized
()
{
if
(
WidgetsBinding
.
instance
==
null
)
{
if
(
Platform
.
environment
.
containsKey
(
'FLUTTER_TEST'
))
{
if
(
isBrowser
||
Platform
.
environment
.
containsKey
(
'FLUTTER_TEST'
))
{
AutomatedTestWidgetsFlutterBinding
();
}
else
{
LiveTestWidgetsFlutterBinding
();
...
...
@@ -248,6 +249,9 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
return
TestAsyncUtils
.
guard
<
void
>(()
async
{
assert
(
inTest
);
final
Locale
locale
=
Locale
(
languageCode
,
countryCode
==
''
?
null
:
countryCode
);
if
(
isBrowser
)
{
return
;
}
dispatchLocalesChanged
(<
Locale
>[
locale
]);
});
}
...
...
@@ -586,7 +590,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
runApp
(
Container
(
key:
UniqueKey
(),
child:
_preTestMessage
));
// Reset the tree to a known state.
await
pump
();
final
bool
autoUpdateGoldensBeforeTest
=
autoUpdateGoldenFiles
;
final
bool
autoUpdateGoldensBeforeTest
=
autoUpdateGoldenFiles
&&
!
isBrowser
;
final
TestExceptionReporter
reportTestExceptionBeforeTest
=
reportTestException
;
final
ErrorWidgetBuilder
errorWidgetBuilderBeforeTest
=
ErrorWidget
.
builder
;
...
...
@@ -601,7 +605,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
runApp
(
Container
(
key:
UniqueKey
(),
child:
_postTestMessage
));
// Unmount any remaining widgets.
await
pump
();
invariantTester
();
_verifyAutoUpdateGoldensUnset
(
autoUpdateGoldensBeforeTest
);
_verifyAutoUpdateGoldensUnset
(
autoUpdateGoldensBeforeTest
&&
!
isBrowser
);
_verifyReportTestExceptionUnset
(
reportTestExceptionBeforeTest
);
_verifyErrorWidgetBuilderUnset
(
errorWidgetBuilderBeforeTest
);
_verifyInvariants
();
...
...
@@ -750,6 +754,9 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
static
Set
<
String
>
_allowedAssetKeys
;
void
_mockFlutterAssets
()
{
if
(
isBrowser
)
{
return
;
}
if
(!
Platform
.
environment
.
containsKey
(
'UNIT_TEST_ASSETS'
))
{
return
;
}
...
...
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