Files
react-native/ReactCommon/react/test_utils/MockSurfaceHandler.h
T
Phillip Pan ec92c85a15 introduce MockSurfaceHandler
Summary:
Changelog:
[ios][added] - introduce MockSurfaceHandler

following the recommendation in https://fb.workplace.com/groups/474291069286180/posts/6540719469309946

in order to unit test classes that use SurfaceHandler, we need to be able to mock it somehow - since the class is final we aren't able to do that. in this diff, we add the mock class.

Reviewed By: sammy-SC

Differential Revision: D30578927

fbshipit-source-id: 9b39b03ad0b55cecd9b482f9cce9630d7e7d5bda
2021-08-26 22:40:43 -07:00

26 lines
570 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <gmock/gmock.h>
#include <react/renderer/scheduler/SurfaceHandler.h>
namespace facebook {
namespace react {
class MockSurfaceHandler : public SurfaceHandler {
public:
MockSurfaceHandler() : SurfaceHandler("moduleName", 0){};
MOCK_QUALIFIED_METHOD1(setDisplayMode, const noexcept, void(DisplayMode));
};
} // namespace react
} // namespace facebook