@@ -525,125 +525,6 @@ main() {
525525 expect (vmServiceUri.path, matches (vmServiceAuthCodePathPattern));
526526 });
527527
528- for (final folderName in ['bin' , 'lib' ]) {
529- /// Gets the expected name and URI for a macro-generated source.
530- ({String name, Uri fileLikeUri}) getExpectedMacroSource (File testFile) {
531- // Drive letters are always normalized to uppercase so expect
532- // uppercase in the path part of the macro URI.
533- final fileLikeUri = Uri .file (uppercaseDriveLetter (testFile.path))
534- .replace (scheme: 'dart-macro+file' );
535- // The expected source name will differ for inside/outside the lib
536- // folder.
537- final name = folderName == 'lib'
538- ? 'dart-macro+package:my_test_project/main.dart'
539- : fileLikeUri.toString ();
540-
541- return (name: name, fileLikeUri: fileLikeUri);
542- }
543-
544- test (
545- 'can download source code from the VM for macro-generated files '
546- 'in "$folderName " when the client does not support Dart URIs' ,
547- () async {
548- final client = dap.client;
549-
550- // Create the macro impl, the script that uses it and set up macro
551- // support.
552- dap.createTestFile (
553- filename: '$folderName /with_hello.dart' ,
554- withHelloMacroImplementation,
555- );
556- final testFile = dap.createTestFile (
557- filename: '$folderName /main.dart' ,
558- withHelloMacroProgram,
559- );
560- dap.createPubspec (dap.testAppDir, 'my_test_project' );
561- await dap.enableMacroSupport ();
562- final macroSource = getExpectedMacroSource (testFile);
563-
564- // Hit the initial breakpoint.
565- final breakpointLine = lineWith (testFile, breakpointMarker);
566- final stop = await dap.client.hitBreakpoint (
567- testFile,
568- breakpointLine,
569- toolArgs: ['--enable-experiment=macros' ],
570- );
571-
572- // Step in to the hello() method provided by the macro.
573- final responses = await Future .wait ([
574- client.expectStop ('step' , sourceName: macroSource.name),
575- client.stepIn (stop.threadId! ),
576- ], eagerError: true );
577- final stopResponse = responses.first as StoppedEventBody ;
578-
579- // Fetch the top stack frame (which should be inside print).
580- final stack = await client.getValidStack (
581- stopResponse.threadId! ,
582- startFrame: 0 ,
583- numFrames: 1 ,
584- );
585- final topFrame = stack.stackFrames.first;
586-
587- // Downloaded macro sources should have a sourceReference and no path.
588- expect (topFrame.source! .path, isNull);
589- expect (topFrame.source! .sourceReference, isPositive);
590-
591- // Source code should contain the augmentation for class A.
592- final source = await client.getValidSource (topFrame.source! );
593- expect (source.content, contains ('augment class A' ));
594- });
595-
596- test (
597- 'can use local source code for macro-generated files '
598- 'in "$folderName " when the client supports Dart URIs' , () async {
599- final client = dap.client;
600-
601- // Create the macro impl, the script that uses it and set up macro
602- // support.
603- dap.createTestFile (
604- filename: '$folderName /with_hello.dart' ,
605- withHelloMacroImplementation,
606- );
607- final testFile = dap.createTestFile (
608- filename: '$folderName /main.dart' ,
609- withHelloMacroProgram,
610- );
611- dap.createPubspec (dap.testAppDir, 'my_test_project' );
612- await dap.enableMacroSupport ();
613- final macroSource = getExpectedMacroSource (testFile);
614- // Tell the DA we can handle the special URIs.
615- client.supportUris = true ;
616-
617- // Hit the initial breakpoint.
618- final breakpointLine = lineWith (testFile, breakpointMarker);
619- final stop = await dap.client.hitBreakpoint (
620- testFile,
621- breakpointLine,
622- toolArgs: ['--enable-experiment=macros' ],
623- );
624-
625- // Step in to the hello() method provided by the macro.
626- final responses = await Future .wait ([
627- client.expectStop ('step' , sourceName: macroSource.name),
628- client.stepIn (stop.threadId! ),
629- ], eagerError: true );
630- final stopResponse = responses.first as StoppedEventBody ;
631-
632- // Fetch the top stack frame (which should be inside print).
633- final stack = await client.getValidStack (
634- stopResponse.threadId! ,
635- startFrame: 0 ,
636- numFrames: 1 ,
637- );
638- final topFrame = stack.stackFrames.first;
639-
640- // When we use local editor-provided sources, there should be a URI in
641- // pathand no sourceReference.
642- expect (topFrame.source! .sourceReference, isNull);
643- expect (topFrame.source! .path, macroSource.fileLikeUri.toString ());
644- });
645- }
646-
647528 test ('can map SDK source code to a local path' , () async {
648529 final client = dap.client;
649530 final testFile = dap.createTestFile (simpleBreakpointProgram);
0 commit comments