Clean up crash reporting code (#8602)
This commit is contained in:
@@ -15,26 +15,22 @@ import 'package:flutter_tools/executable.dart' as tools;
|
||||
import 'package:flutter_tools/src/base/context.dart';
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/base/os.dart' as os;
|
||||
import 'package:flutter_tools/src/crash_reporting.dart';
|
||||
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
||||
import 'src/context.dart';
|
||||
|
||||
void main() {
|
||||
group('crash reporting', () {
|
||||
int testPort;
|
||||
|
||||
setUp(() async {
|
||||
tools.crashFileSystem = new MemoryFileSystem();
|
||||
setExitFunctionForTests((_) { });
|
||||
testPort = await os.findAvailablePort();
|
||||
overrideBaseCrashUrlForTesting(Uri.parse('http://localhost:$testPort/test-path'));
|
||||
enterTestingMode();
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
tools.crashFileSystem = new LocalFileSystem();
|
||||
restoreExitFunction();
|
||||
resetBaseCrashUrlForTesting();
|
||||
exitTestingMode();
|
||||
});
|
||||
|
||||
testUsingContext('should send crash reports', () async {
|
||||
@@ -62,10 +58,10 @@ void main() {
|
||||
// Verify that we sent the crash report.
|
||||
expect(method, 'POST');
|
||||
expect(uri, new Uri(
|
||||
scheme: 'http',
|
||||
host: 'localhost',
|
||||
port: testPort,
|
||||
path: '/test-path',
|
||||
scheme: 'https',
|
||||
host: 'clients2.google.com',
|
||||
port: 443,
|
||||
path: '/cr/staging_report',
|
||||
queryParameters: <String, String>{
|
||||
'product': 'Flutter_Tools',
|
||||
'version' : 'test-version',
|
||||
|
||||
Reference in New Issue
Block a user