// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import'dart:io';import'package:flutter_test/flutter_test.dart';import'package:integration_test/integration_test.dart';classSocketExceptionHttpClientextendsFakeimplementsHttpClient{@overrideFuture<HttpClientRequest>openUrl(Stringmethod,Uriurl){throwconstSocketException('always throw');}}Future<void>main()async{finalIntegrationTestWidgetsFlutterBindingbinding=IntegrationTestWidgetsFlutterBinding.ensureInitialized()asIntegrationTestWidgetsFlutterBinding;test('Prints an appropriate message on socket exception',()async{boolgotStateError=false;try{awaitbinding.enableTimeline(httpClient:SocketExceptionHttpClient());}onStateErrorcatch(e){gotStateError=true;expect(e.toString(),contains('This may happen if DDS is enabled'));}onSocketExceptioncatch(_){fail('Did not expect a socket exception.');}expect(gotStateError,true);});}