[dds/dap] Always expect uppercase drive letters from DAP

Some of these tests failed if `Directory.systemTemp` had a lowercase drive letter because DAP always normalises outbound paths to uppercase and we were comparing them directly.

This updates offending tests to compare with uppercase drive letters as is expected, regardless of the original temp directory (used for "cwd" and "program").

Fixes https://github.com/dart-lang/sdk/issues/53949

Change-Id: Ibaa6b6ecfe3d77aeff5b806174167c9452167db6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
diff --git a/pkg/dds/lib/src/dap/adapters/dart.dart b/pkg/dds/lib/src/dap/adapters/dart.dart
index e1be4d6..027f68f 100644
--- a/pkg/dds/lib/src/dap/adapters/dart.dart
+++ b/pkg/dds/lib/src/dap/adapters/dart.dart
@@ -616,7 +616,7 @@
   /// of attach) or from something like a vm-service-info file or Flutter
   /// app.debugPort message.
   ///
-  /// The URI protocol will be changed to ws/wss but otherwise not normalised.
+  /// The URI protocol will be changed to ws/wss but otherwise not normalized.
   /// The caller should handle any other normalisation (such as adding /ws to
   /// the end if required).
   Future<void> connectDebugger(Uri uri) async {
diff --git a/pkg/dds/test/dap/integration/debug_test.dart b/pkg/dds/test/dap/integration/debug_test.dart
index 8f846fd..f78f662 100644
--- a/pkg/dds/test/dap/integration/debug_test.dart
+++ b/pkg/dds/test/dap/integration/debug_test.dart
@@ -89,7 +89,10 @@
       expect(proc, isNotNull);
       expect(
         runInTerminalArgs!.args,
-        containsAllInOrder([Platform.resolvedExecutable, testFile.path]),
+        containsAllInOrder([
+          Platform.resolvedExecutable,
+          dap.client.uppercaseDriveLetter(testFile.path),
+        ]),
       );
       expect(proc!.pid, isPositive);
       expect(proc!.exitCode, completes);
diff --git a/pkg/dds/test/dap/integration/no_debug_test.dart b/pkg/dds/test/dap/integration/no_debug_test.dart
index 00fccb7..7641222 100644
--- a/pkg/dds/test/dap/integration/no_debug_test.dart
+++ b/pkg/dds/test/dap/integration/no_debug_test.dart
@@ -70,7 +70,10 @@
       expect(runInTerminalArgs, isNotNull);
       expect(
         runInTerminalArgs!.args,
-        containsAllInOrder([Platform.resolvedExecutable, testFile.path]),
+        containsAllInOrder([
+          Platform.resolvedExecutable,
+          dap.client.uppercaseDriveLetter(testFile.path),
+        ]),
       );
     });
     // These tests can be slow due to starting up the external server process.
diff --git a/pkg/dds/test/dap/integration/test_client.dart b/pkg/dds/test/dap/integration/test_client.dart
index 15b614a..c23dff2 100644
--- a/pkg/dds/test/dap/integration/test_client.dart
+++ b/pkg/dds/test/dap/integration/test_client.dart
@@ -726,7 +726,17 @@
     );
   }
 
-  /// Normalizes a non-breakpoint path being sent to the debug adapter based on
+  /// Normalizes a a path to have an uppercase drive letter. All paths verified
+  /// that come out of the adapter are normalized this way so test expectations
+  /// should be normalized the same way before comparing.
+  String uppercaseDriveLetter(String path) {
+    return _forceDriveLetterCasing(
+      path,
+      upper: true,
+    );
+  }
+
+  /// Normalizes a breakpoint path being sent to the debug adapter based on
   /// the values of [forceBreakpointDriveLetterCasingUpper] and
   /// [forceBreakpointDriveLetterCasingLower].
   String _normalizeBreakpointPath(String path) {
@@ -869,7 +879,7 @@
       final frame = result.stackFrames[0];
 
       if (file != null) {
-        expect(frame.source?.path, equals(file.path));
+        expect(frame.source?.path, equals(uppercaseDriveLetter(file.path)));
       }
       if (sourceName != null) {
         expect(frame.source?.name, equals(sourceName));