[chromium-style] Split mock constructors/destructors to cpp files.
This CL moves the constructors and desctructors for the native unittest mocks into separate cpp files. Bug: dawn:1405 Change-Id: I20dccaa8114f3d7f8b61da1c1495648cb7328148 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89121 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
e6e96def66
commit
bcdb6e9da8
|
@ -157,19 +157,32 @@ source_set("native_mocks_sources") {
|
|||
configs += [ "${dawn_root}/src/dawn/native:internal" ]
|
||||
|
||||
sources = [
|
||||
"unittests/native/mocks/BindGroupLayoutMock.cpp",
|
||||
"unittests/native/mocks/BindGroupLayoutMock.h",
|
||||
"unittests/native/mocks/BindGroupMock.cpp",
|
||||
"unittests/native/mocks/BindGroupMock.h",
|
||||
"unittests/native/mocks/BufferMock.cpp",
|
||||
"unittests/native/mocks/BufferMock.h",
|
||||
"unittests/native/mocks/CommandBufferMock.cpp",
|
||||
"unittests/native/mocks/CommandBufferMock.h",
|
||||
"unittests/native/mocks/ComputePipelineMock.cpp",
|
||||
"unittests/native/mocks/ComputePipelineMock.h",
|
||||
"unittests/native/mocks/DeviceMock.h",
|
||||
"unittests/native/mocks/ExternalTextureMock.cpp",
|
||||
"unittests/native/mocks/ExternalTextureMock.h",
|
||||
"unittests/native/mocks/PipelineLayoutMock.cpp",
|
||||
"unittests/native/mocks/PipelineLayoutMock.h",
|
||||
"unittests/native/mocks/QuerySetMock.cpp",
|
||||
"unittests/native/mocks/QuerySetMock.h",
|
||||
"unittests/native/mocks/RenderPipelineMock.cpp",
|
||||
"unittests/native/mocks/RenderPipelineMock.h",
|
||||
"unittests/native/mocks/SamplerMock.cpp",
|
||||
"unittests/native/mocks/SamplerMock.h",
|
||||
"unittests/native/mocks/ShaderModuleMock.cpp",
|
||||
"unittests/native/mocks/ShaderModuleMock.h",
|
||||
"unittests/native/mocks/SwapChainMock.cpp",
|
||||
"unittests/native/mocks/SwapChainMock.h",
|
||||
"unittests/native/mocks/TextureMock.cpp",
|
||||
"unittests/native/mocks/TextureMock.h",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/BindGroupLayoutMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
BindGroupLayoutMock::BindGroupLayoutMock(DeviceBase* device) : BindGroupLayoutBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->BindGroupLayoutBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
|
||||
BindGroupLayoutMock::~BindGroupLayoutMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class BindGroupLayoutMock final : public BindGroupLayoutBase {
|
||||
public:
|
||||
explicit BindGroupLayoutMock(DeviceBase* device) : BindGroupLayoutBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->BindGroupLayoutBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
~BindGroupLayoutMock() override = default;
|
||||
explicit BindGroupLayoutMock(DeviceBase* device);
|
||||
~BindGroupLayoutMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/BindGroupMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
BindGroupMock::BindGroupMock(DeviceBase* device) : BindGroupBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BindGroupBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
BindGroupMock::~BindGroupMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class BindGroupMock : public BindGroupBase {
|
||||
public:
|
||||
explicit BindGroupMock(DeviceBase* device) : BindGroupBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BindGroupBase::DestroyImpl(); });
|
||||
}
|
||||
~BindGroupMock() override = default;
|
||||
explicit BindGroupMock(DeviceBase* device);
|
||||
~BindGroupMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/BufferMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
BufferMock::BufferMock(DeviceBase* device, BufferBase::BufferState state)
|
||||
: BufferBase(device, state) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BufferBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
BufferMock::~BufferMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class BufferMock : public BufferBase {
|
||||
public:
|
||||
BufferMock(DeviceBase* device, BufferBase::BufferState state) : BufferBase(device, state) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BufferBase::DestroyImpl(); });
|
||||
}
|
||||
~BufferMock() override = default;
|
||||
BufferMock(DeviceBase* device, BufferBase::BufferState state);
|
||||
~BufferMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/CommandBufferMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
CommandBufferMock::CommandBufferMock(DeviceBase* device) : CommandBufferBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->CommandBufferBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
CommandBufferMock::~CommandBufferMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class CommandBufferMock : public CommandBufferBase {
|
||||
public:
|
||||
explicit CommandBufferMock(DeviceBase* device) : CommandBufferBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->CommandBufferBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
~CommandBufferMock() override = default;
|
||||
explicit CommandBufferMock(DeviceBase* device);
|
||||
~CommandBufferMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/ComputePipelineMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
ComputePipelineMock::ComputePipelineMock(DeviceBase* device) : ComputePipelineBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->ComputePipelineBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
|
||||
ComputePipelineMock::~ComputePipelineMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class ComputePipelineMock : public ComputePipelineBase {
|
||||
public:
|
||||
explicit ComputePipelineMock(DeviceBase* device) : ComputePipelineBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->ComputePipelineBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
~ComputePipelineMock() override = default;
|
||||
explicit ComputePipelineMock(DeviceBase* device);
|
||||
~ComputePipelineMock() override;
|
||||
|
||||
MOCK_METHOD(MaybeError, Initialize, (), (override));
|
||||
MOCK_METHOD(size_t, ComputeContentHash, (), (override));
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/ExternalTextureMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
ExternalTextureMock::ExternalTextureMock(DeviceBase* device) : ExternalTextureBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->ExternalTextureBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
|
||||
ExternalTextureMock::~ExternalTextureMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class ExternalTextureMock : public ExternalTextureBase {
|
||||
public:
|
||||
explicit ExternalTextureMock(DeviceBase* device) : ExternalTextureBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->ExternalTextureBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
~ExternalTextureMock() override = default;
|
||||
explicit ExternalTextureMock(DeviceBase* device);
|
||||
~ExternalTextureMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/PipelineLayoutMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
PipelineLayoutMock::PipelineLayoutMock(DeviceBase* device) : PipelineLayoutBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->PipelineLayoutBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
|
||||
PipelineLayoutMock::~PipelineLayoutMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class PipelineLayoutMock : public PipelineLayoutBase {
|
||||
public:
|
||||
explicit PipelineLayoutMock(DeviceBase* device) : PipelineLayoutBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->PipelineLayoutBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
~PipelineLayoutMock() override = default;
|
||||
explicit PipelineLayoutMock(DeviceBase* device);
|
||||
~PipelineLayoutMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/QuerySetMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
QuerySetMock::QuerySetMock(DeviceBase* device) : QuerySetBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->QuerySetBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
QuerySetMock::~QuerySetMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class QuerySetMock : public QuerySetBase {
|
||||
public:
|
||||
explicit QuerySetMock(DeviceBase* device) : QuerySetBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->QuerySetBase::DestroyImpl(); });
|
||||
}
|
||||
~QuerySetMock() override = default;
|
||||
explicit QuerySetMock(DeviceBase* device);
|
||||
~QuerySetMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/RenderPipelineMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
RenderPipelineMock::RenderPipelineMock(DeviceBase* device) : RenderPipelineBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->RenderPipelineBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
|
||||
RenderPipelineMock::~RenderPipelineMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class RenderPipelineMock : public RenderPipelineBase {
|
||||
public:
|
||||
explicit RenderPipelineMock(DeviceBase* device) : RenderPipelineBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->RenderPipelineBase::DestroyImpl();
|
||||
});
|
||||
}
|
||||
~RenderPipelineMock() override = default;
|
||||
explicit RenderPipelineMock(DeviceBase* device);
|
||||
~RenderPipelineMock() override;
|
||||
|
||||
MOCK_METHOD(MaybeError, Initialize, (), (override));
|
||||
MOCK_METHOD(size_t, ComputeContentHash, (), (override));
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/SamplerMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
SamplerMock::SamplerMock(DeviceBase* device) : SamplerBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SamplerBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
SamplerMock::~SamplerMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class SamplerMock : public SamplerBase {
|
||||
public:
|
||||
explicit SamplerMock(DeviceBase* device) : SamplerBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SamplerBase::DestroyImpl(); });
|
||||
}
|
||||
~SamplerMock() override = default;
|
||||
explicit SamplerMock(DeviceBase* device);
|
||||
~SamplerMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
|
@ -20,6 +20,8 @@ ShaderModuleMock::ShaderModuleMock(DeviceBase* device) : ShaderModuleBase(device
|
|||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->ShaderModuleBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
ShaderModuleMock::~ShaderModuleMock() = default;
|
||||
|
||||
ResultOrError<Ref<ShaderModuleMock>> ShaderModuleMock::Create(DeviceBase* device,
|
||||
const char* source) {
|
||||
ShaderModuleMock* mock = new ShaderModuleMock(device);
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace dawn::native {
|
|||
class ShaderModuleMock : public ShaderModuleBase {
|
||||
public:
|
||||
explicit ShaderModuleMock(DeviceBase* device);
|
||||
~ShaderModuleMock() override = default;
|
||||
~ShaderModuleMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/SwapChainMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
SwapChainMock::SwapChainMock(DeviceBase* device) : SwapChainBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SwapChainBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
SwapChainMock::~SwapChainMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
|||
|
||||
class SwapChainMock : public SwapChainBase {
|
||||
public:
|
||||
explicit SwapChainMock(DeviceBase* device) : SwapChainBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SwapChainBase::DestroyImpl(); });
|
||||
}
|
||||
~SwapChainMock() override = default;
|
||||
explicit SwapChainMock(DeviceBase* device);
|
||||
~SwapChainMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2022 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/tests/unittests/native/mocks/TextureMock.h"
|
||||
|
||||
namespace dawn::native {
|
||||
|
||||
TextureMock::TextureMock(DeviceBase* device, TextureBase::TextureState state)
|
||||
: TextureBase(device, state) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->TextureBase::DestroyImpl(); });
|
||||
}
|
||||
|
||||
TextureMock::~TextureMock() = default;
|
||||
|
||||
TextureViewMock::TextureViewMock(TextureBase* texture) : TextureViewBase(texture) {}
|
||||
|
||||
TextureViewMock::~TextureViewMock() = default;
|
||||
|
||||
} // namespace dawn::native
|
|
@ -24,18 +24,16 @@ namespace dawn::native {
|
|||
|
||||
class TextureMock : public TextureBase {
|
||||
public:
|
||||
TextureMock(DeviceBase* device, TextureBase::TextureState state) : TextureBase(device, state) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->TextureBase::DestroyImpl(); });
|
||||
}
|
||||
~TextureMock() override = default;
|
||||
TextureMock(DeviceBase* device, TextureBase::TextureState state);
|
||||
~TextureMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
||||
class TextureViewMock : public TextureViewBase {
|
||||
public:
|
||||
explicit TextureViewMock(TextureBase* texture) : TextureViewBase(texture) {}
|
||||
~TextureViewMock() override = default;
|
||||
explicit TextureViewMock(TextureBase* texture);
|
||||
~TextureViewMock() override;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue