Make the templates of mocking api flexible

Rename mock_webgpu to mock_api and define the function "GetProcTableAndDevice" to "GetProcTable" for removing the special arguments "WGPUDevice* device" that can be got with "GetNewDevice()".

BUG=dawn:1201

Change-Id: I4fc47e4497ba4b6d280cc8af8605f1d93f43497e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72761
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Junwei Fu <junwei.fu@intel.com>
This commit is contained in:
fujunwei
2021-12-15 04:35:26 +00:00
committed by Dawn LUCI CQ
parent 5204053954
commit 16ae3b8b95
7 changed files with 28 additions and 23 deletions

View File

@@ -38,8 +38,8 @@ server::MemoryTransferService* WireTest::GetServerMemoryTransferService() {
void WireTest::SetUp() {
DawnProcTable mockProcs;
WGPUDevice mockDevice;
api.GetProcTableAndDevice(&mockProcs, &mockDevice);
api.GetProcTable(&mockProcs);
WGPUDevice mockDevice = api.GetNewDevice();
// This SetCallback call cannot be ignored because it is done as soon as we start the server
EXPECT_CALL(api, OnDeviceSetUncapturedErrorCallback(_, _, _)).Times(Exactly(1));