Fix multiple device leaks in dawn_end2end_tests and dawn_unittests

Adds ForTesting APIs to the instance to track the number of devices.

Bug: dawn:1164
Change-Id: Ib743afb1e86ef16740d49613f43f9e2f009232bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90583
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng
2022-05-18 13:28:21 +00:00
committed by Dawn LUCI CQ
parent b5d73ccbea
commit ba2b7fc9b1
15 changed files with 57 additions and 20 deletions

View File

@@ -170,6 +170,8 @@ class DAWN_NATIVE_EXPORT Instance {
// TODO(dawn:1374) Deprecate this once it is passed via the descriptor.
void SetPlatform(dawn::platform::Platform* platform);
uint64_t GetDeviceCountForTesting() const;
// Returns the underlying WGPUInstance object.
WGPUInstance Get() const;