@@ -2035,12 +2035,13 @@ flutter:
20352035 fakeVmServiceHost = FakeVmServiceHost (requests: < VmServiceExpectation > []);
20362036 final FakeDevice device = FakeDevice ()
20372037 ..dds = DartDevelopmentService ();
2038- ddsLauncherCallback = (Uri uri, {bool enableAuthCodes, bool ipv6, Uri serviceUri, List <String > cachedUserTags}) {
2038+ ddsLauncherCallback = (Uri uri, {bool enableAuthCodes, bool ipv6, Uri serviceUri, List <String > cachedUserTags, dds. UriConverter uriConverter }) {
20392039 expect (uri, Uri (scheme: 'foo' , host: 'bar' ));
20402040 expect (enableAuthCodes, isTrue);
20412041 expect (ipv6, isFalse);
20422042 expect (serviceUri, Uri (scheme: 'http' , host: '127.0.0.1' , port: 0 ));
20432043 expect (cachedUserTags, isEmpty);
2044+ expect (uriConverter, isNull);
20442045 throw FakeDartDevelopmentServiceException (message:
20452046 'Existing VM service clients prevent DDS from taking control.' ,
20462047 );
@@ -2083,12 +2084,13 @@ flutter:
20832084 final FakeDevice device = FakeDevice ()
20842085 ..dds = DartDevelopmentService ();
20852086 final Completer <void >done = Completer <void >();
2086- ddsLauncherCallback = (Uri uri, {bool enableAuthCodes, bool ipv6, Uri serviceUri, List <String > cachedUserTags}) async {
2087+ ddsLauncherCallback = (Uri uri, {bool enableAuthCodes, bool ipv6, Uri serviceUri, List <String > cachedUserTags, dds. UriConverter uriConverter }) async {
20872088 expect (uri, Uri (scheme: 'foo' , host: 'bar' ));
20882089 expect (enableAuthCodes, isFalse);
20892090 expect (ipv6, isTrue);
20902091 expect (serviceUri, Uri (scheme: 'http' , host: '::1' , port: 0 ));
20912092 expect (cachedUserTags, isEmpty);
2093+ expect (uriConverter, isNull);
20922094 done.complete ();
20932095 return null ;
20942096 };
@@ -2111,16 +2113,52 @@ flutter:
21112113 }) async => FakeVmServiceHost (requests: < VmServiceExpectation > []).vmService,
21122114 }));
21132115
2116+ testUsingContext ('Context includes URI converter' , () => testbed.run (() async {
2117+ fakeVmServiceHost = FakeVmServiceHost (requests: < VmServiceExpectation > []);
2118+ final FakeDevice device = FakeDevice ()
2119+ ..dds = DartDevelopmentService ();
2120+ final Completer <void >done = Completer <void >();
2121+ ddsLauncherCallback = (Uri uri, {bool enableAuthCodes, bool ipv6, Uri serviceUri, List <String > cachedUserTags, dds.UriConverter uriConverter}) async {
2122+ expect (uri, Uri (scheme: 'foo' , host: 'bar' ));
2123+ expect (enableAuthCodes, isFalse);
2124+ expect (ipv6, isTrue);
2125+ expect (serviceUri, Uri (scheme: 'http' , host: '::1' , port: 0 ));
2126+ expect (cachedUserTags, isEmpty);
2127+ expect (uriConverter, isNotNull);
2128+ done.complete ();
2129+ return null ;
2130+ };
2131+ final TestFlutterDevice flutterDevice = TestFlutterDevice (
2132+ device,
2133+ observatoryUris: Stream <Uri >.value (testUri),
2134+ );
2135+ await flutterDevice.connect (allowExistingDdsInstance: true , ipv6: true , disableServiceAuthCodes: true );
2136+ await done.future;
2137+ }, overrides: < Type , Generator > {
2138+ VMServiceConnector : () => (Uri httpUri, {
2139+ ReloadSources reloadSources,
2140+ Restart restart,
2141+ CompileExpression compileExpression,
2142+ GetSkSLMethod getSkSLMethod,
2143+ PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
2144+ io.CompressionOptions compression,
2145+ Device device,
2146+ Logger logger,
2147+ }) async => FakeVmServiceHost (requests: < VmServiceExpectation > []).vmService,
2148+ dds.UriConverter : () => (String uri) => 'test' ,
2149+ }));
2150+
21142151 testUsingContext ('Failed DDS start outputs error message' , () => testbed.run (() async {
21152152 // See https://github.com/flutter/flutter/issues/72385 for context.
21162153 final FakeDevice device = FakeDevice ()
21172154 ..dds = DartDevelopmentService ();
2118- ddsLauncherCallback = (Uri uri, {bool enableAuthCodes, bool ipv6, Uri serviceUri, List <String > cachedUserTags}) {
2155+ ddsLauncherCallback = (Uri uri, {bool enableAuthCodes, bool ipv6, Uri serviceUri, List <String > cachedUserTags, dds. UriConverter uriConverter }) {
21192156 expect (uri, Uri (scheme: 'foo' , host: 'bar' ));
21202157 expect (enableAuthCodes, isTrue);
21212158 expect (ipv6, isFalse);
21222159 expect (serviceUri, Uri (scheme: 'http' , host: '127.0.0.1' , port: 0 ));
21232160 expect (cachedUserTags, isEmpty);
2161+ expect (uriConverter, isNull);
21242162 throw FakeDartDevelopmentServiceException (message: 'No URI' );
21252163 };
21262164 final TestFlutterDevice flutterDevice = TestFlutterDevice (
0 commit comments