Dawn: fix for crash on GrContextFactory_sharedContexts unit test.

Like Vulkan, Dawn requires "early abandon", so that the wgpu::Device is
freed before the dawn_native::Instance which created it.

Bug: skia:10334
Change-Id: I72346b724868790ede69c3cb09641e9054ef738e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294602
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index 13cc979..f7356f5 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -90,7 +90,8 @@
                 auto restore = context.fTestContext->makeCurrentAndAutoRestore();
                 context.fTestContext->testAbandon();
             }
-            bool requiresEarlyAbandon = (context.fGrContext->backend() == GrBackendApi::kVulkan);
+            GrBackendApi api = context.fGrContext->backend();
+            bool requiresEarlyAbandon = api == GrBackendApi::kVulkan || api == GrBackendApi::kDawn;
             if (requiresEarlyAbandon) {
                 context.fGrContext->abandonContext();
             }