Remove win+qualcom test suppressions

This is a partial revert of [1]. A bug in FetchMax() was causing
WaitAny() to return without updating the completed serial and causing
test failures. The bug was fixed so remove test suppressions. This also
reverts the change to use a stack allocated MapAsync callback added as a
workaround in that CL.

[1] https://dawn-review.googlesource.com/c/dawn/+/283676.

Bug: 460743383
Change-Id: If8a6d5422e4f2940508bd07ce8b24dde4583e2b4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/289775
Commit-Queue: Kyle Charbonneau <kylechar@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp
index d4131b2..2b2ce02 100644
--- a/src/dawn/tests/DawnTest.cpp
+++ b/src/dawn/tests/DawnTest.cpp
@@ -2088,34 +2088,14 @@
     if (!UsesWire()) {
         // We use a new mock callback here so that the validation on the call happens as soon as the
         // scope of this call ends.
-        auto mockCb =
-            std::make_shared<MockCppCallback<void (*)(wgpu::MapAsyncStatus, wgpu::StringView)>>();
-        EXPECT_CALL(*mockCb, Call(wgpu::MapAsyncStatus::Success, _)).Times(1);
+        MockCppCallback<void (*)(wgpu::MapAsyncStatus, wgpu::StringView)> mockCb;
+        EXPECT_CALL(mockCb, Call(wgpu::MapAsyncStatus::Success, _)).Times(1);
 
-        // TODO(crbug.com/460743383): This is a workaround for teardown causing WaitAny to return
-        // without calling the callback. Revert this to the state before
-        // https://dawn-review.googlesource.com/c/dawn/+/273736 when this is fixed.
-        // The mock callback is local to this function, but the async map request can live longer
-        // if the test times out. To prevent a use-after-free, we use a shared pointer to
-        // control the mock callback's availability.
-        wgpu::WaitStatus status = instance.WaitAny(
-            buffer.MapAsync(mapMode, offset, size, wgpu::CallbackMode::WaitAnyOnly,
-                            [mockCb](wgpu::MapAsyncStatus status, wgpu::StringView message) {
-                                if (mockCb != nullptr) {
-                                    mockCb->Callback()(status, message);
-                                }
-                            }),
-            UINT64_MAX);
-
-        // Disarm the callback. Since we need to verify expectations on the
-        // callback after disarming it, swap with a nullptr instead of simply
-        // setting it to null directly.
-        auto swappedCb =
-            std::make_shared<MockCppCallback<void (*)(wgpu::MapAsyncStatus, wgpu::StringView)>>();
-        swappedCb.reset();
-        mockCb.swap(swappedCb);
-        testing::Mock::VerifyAndClearExpectations(swappedCb.get());
-        ASSERT_EQ(status, wgpu::WaitStatus::Success);
+        ASSERT_EQ(
+            instance.WaitAny(buffer.MapAsync(mapMode, offset, size, wgpu::CallbackMode::WaitAnyOnly,
+                                             mockCb.Callback()),
+                             UINT64_MAX),
+            wgpu::WaitStatus::Success);
     } else {
         bool done = false;
         buffer.MapAsync(mapMode, offset, size, wgpu::CallbackMode::AllowProcessEvents,
diff --git a/src/dawn/tests/end2end/BufferTests.cpp b/src/dawn/tests/end2end/BufferTests.cpp
index 7ddf3bf..82131b9 100644
--- a/src/dawn/tests/end2end/BufferTests.cpp
+++ b/src/dawn/tests/end2end/BufferTests.cpp
@@ -125,11 +125,6 @@
 
 // Test that the simplest map read works
 TEST_P(BufferMappingTests, MapRead_Basic) {
-    // TODO(crbug.com/469328928, crbug.com/465497435): Flakily times out on
-    // Snapdragon X Elite SoCs, suspected of causing a crash in global test
-    // teardown as a result.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     wgpu::Buffer buffer = CreateMapReadBuffer(4);
 
     const uint32_t myData = 0x01020304;
@@ -144,11 +139,6 @@
 
 // Test map-reading a zero-sized buffer.
 TEST_P(BufferMappingTests, MapRead_ZeroSized) {
-    // TODO(crbug.com/469328928, crbug.com/465497435): Flakily times out on
-    // Snapdragon X Elite SoCs, suspected of causing a crash in global test
-    // teardown as a result.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     wgpu::Buffer buffer = CreateMapReadBuffer(0);
 
     MapAsyncAndWait(buffer, wgpu::MapMode::Read, 0, wgpu::kWholeMapSize);
@@ -158,11 +148,6 @@
 
 // Test map-reading with a non-zero offset
 TEST_P(BufferMappingTests, MapRead_NonZeroOffset) {
-    // TODO(crbug.com/469328928, crbug.com/465497435): Flakily times out on
-    // Snapdragon X Elite SoCs, suspected of causing a crash in global test
-    // teardown as a result.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     uint32_t myData[3] = {0x01020304, 0x05060708, 0x090A0B0C};
 
     wgpu::Buffer buffer = CreateMapReadBuffer(sizeof(myData));
@@ -180,11 +165,6 @@
 
 // Map read and unmap twice. Test that both of these two iterations work.
 TEST_P(BufferMappingTests, MapRead_Twice) {
-    // TODO(crbug.com/469328928, crbug.com/465497435): Flakily times out on
-    // Snapdragon X Elite SoCs, suspected of causing a crash in global test
-    // teardown as a result.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     wgpu::Buffer buffer = CreateMapReadBuffer(4);
 
     uint32_t myData = 0x01020304;
@@ -204,11 +184,6 @@
 
 // Map read and test multiple get mapped range data
 TEST_P(BufferMappingTests, MapRead_MultipleMappedRange) {
-    // TODO(crbug.com/469328928, crbug.com/465497435): Flakily times out on
-    // Snapdragon X Elite SoCs, suspected of causing a crash in global test
-    // teardown as a result.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     wgpu::Buffer buffer = CreateMapReadBuffer(12);
 
     uint32_t myData[] = {0x00010203, 0x04050607, 0x08090a0b};
@@ -224,11 +199,6 @@
 
 // Test map-reading a large buffer.
 TEST_P(BufferMappingTests, MapRead_Large) {
-    // TODO(crbug.com/469328928, crbug.com/465497435): Flakily times out on
-    // Snapdragon X Elite SoCs, suspected of causing a crash in global test
-    // teardown as a result.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     constexpr uint32_t kDataSize = 1000 * 1000;
     constexpr size_t kByteSize = kDataSize * sizeof(uint32_t);
     wgpu::Buffer buffer = CreateMapReadBuffer(kByteSize);
@@ -264,11 +234,6 @@
 
 // Test that GetConstMappedRange works inside map-read callback
 TEST_P(BufferMappingTests, MapRead_InCallback) {
-    // TODO(crbug.com/469328928, crbug.com/465497435): Flakily times out on
-    // Snapdragon X Elite SoCs, suspected of causing a crash in global test
-    // teardown as a result.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     constexpr size_t kBufferSize = 12;
     wgpu::Buffer buffer = CreateMapReadBuffer(kBufferSize);
 
@@ -1483,10 +1448,6 @@
         // Skip all tests if the required feature is not supported.
         DAWN_TEST_UNSUPPORTED_IF(!SupportsFeatures({wgpu::FeatureName::BufferMapExtendedUsages}));
 
-        // TODO(crbug.com/465167911): Flakily gets unexpected nullptrs on
-        // Snapdragon X Elite SoCs.
-        DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
         // TODO(crbug.com/473894293): [Capture] validation error: no CopyDst usage.
         DAWN_SUPPRESS_TEST_IF(IsCaptureReplayCheckingEnabled());
     }
diff --git a/src/dawn/tests/end2end/DepthStencilCopyTests.cpp b/src/dawn/tests/end2end/DepthStencilCopyTests.cpp
index 75eb0ed..ddde689 100644
--- a/src/dawn/tests/end2end/DepthStencilCopyTests.cpp
+++ b/src/dawn/tests/end2end/DepthStencilCopyTests.cpp
@@ -690,9 +690,6 @@
 // inevitably written. So we need to make sure the original content of the buffer that's outside of
 // the copy extent is still correctly preserved.
 TEST_P(DepthCopyTests, PreserveBufferContent) {
-    // TODO(crbug.com/461837996): Flaky on Snapdragon X Elite.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     constexpr uint32_t kBufferCopyOffsets[] = {0u, 4u, 512u};
     constexpr uint32_t kTestTextureSizes[][2] = {
         {1, 1},
@@ -1251,9 +1248,6 @@
 // inevitably written. So we need to make sure the original content of the buffer that's outside of
 // the copy extent is still correctly preserved.
 TEST_P(StencilCopyTests, PreserveBufferContent) {
-    // TODO(crbug.com/461837996): Flaky on Snapdragon X Elite.
-    DAWN_SUPPRESS_TEST_IF(IsWindows() && IsQualcomm());
-
     constexpr uint32_t kBufferCopyOffsets[] = {0u, 4u, 512u};
     constexpr uint32_t kTestTextureSizes[][2] = {
         {1, 1},