Add adapter type in test name when the adapter is Microsoft Basic Render

This patch adds the adapter type in the dawn_end2end_test name when the
adapter is Microsoft Basic Render Driver. In a Windows Remote Desktop
session, there will be two adapters whose name is "Microsoft Basic
Render Driver" with one of the adapter type being "CPU" and another
being "Integrated GPU" on an Intel integrated GPU for example. To avoid
the conflicts in the name of end2end tests and causes ASSERT failures,
we add the adapter type to the test name when the adapter is Microsoft
Basic Render Driver.

BUG=dawn:396
TEST=dawn_end2end_tests

Change-Id: I26108ac106957ea7e72d531a366851fd71cbc2b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp
index d715960..21ddcaa 100644
--- a/src/tests/DawnTest.cpp
+++ b/src/tests/DawnTest.cpp
@@ -152,6 +152,16 @@
     }
 
     os << ParamName(param.adapterProperties.backendType) << "_" << sanitizedName.c_str();
+
+    // In a Windows Remote Desktop session there are two adapters named "Microsoft Basic Render
+    // Driver" with different adapter types. We must differentiate them to avoid any tests using the
+    // same name.
+    if (param.adapterProperties.deviceID == 0x008C) {
+        std::string adapterType = AdapterTypeName(param.adapterProperties.adapterType);
+        std::replace(adapterType.begin(), adapterType.end(), ' ', '_');
+        os << "_" << adapterType;
+    }
+
     for (const char* forceEnabledWorkaround : param.forceEnabledWorkarounds) {
         os << "__e_" << forceEnabledWorkaround;
     }