[web][upstream] Don't register exit/saveCompilationTrace for web platform since they are not available (#37812)

* Don't register N/A services exit/saveCompilationTrace for web platform
This commit is contained in:
Ferhat
2019-08-08 14:48:07 -07:00
committed by GitHub
parent 7a236aed12
commit f1ea485018
2 changed files with 4 additions and 3 deletions

View File

@@ -132,7 +132,7 @@ abstract class BindingBase {
return true;
}());
if (!kReleaseMode) {
if (!kReleaseMode && !kIsWeb) {
registerSignalServiceExtension(
name: 'exit',
callback: _exitApplication,

View File

@@ -453,7 +453,8 @@ void main() {
test('Service extensions - exit', () async {
// no test for _calling_ 'exit', because that should terminate the process!
expect(binding.extensions.containsKey('exit'), isTrue);
// Not expecting extension to be available for web platform.
expect(binding.extensions.containsKey('exit'), !isBrowser);
});
test('Service extensions - platformOverride', () async {
@@ -671,5 +672,5 @@ void main() {
expect(trace, contains('dart:core,Object,Object.\n'));
expect(trace, contains('package:test_api/test_api.dart,::,test\n'));
expect(trace, contains('service_extensions_test.dart,::,main\n'));
});
}, skip: isBrowser);
}