This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows] Refactor surface manager mocking (#48953)
See: #48849 (comment)
- Loading branch information
1 parent
ae61286
commit d202141
Showing
5 changed files
with
55 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
shell/platform/windows/testing/mock_angle_surface_manager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_ANGLE_SURFACE_MANAGER_H_ | ||
#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_ANGLE_SURFACE_MANAGER_H_ | ||
|
||
#include "flutter/fml/macros.h" | ||
#include "flutter/shell/platform/windows/angle_surface_manager.h" | ||
#include "gmock/gmock.h" | ||
|
||
namespace flutter { | ||
namespace testing { | ||
|
||
/// Mock for the |AngleSurfaceManager| base class. | ||
class MockAngleSurfaceManager : public AngleSurfaceManager { | ||
public: | ||
MockAngleSurfaceManager() : AngleSurfaceManager(false) {} | ||
|
||
MOCK_METHOD(bool, | ||
CreateSurface, | ||
(WindowsRenderTarget*, EGLint, EGLint), | ||
(override)); | ||
MOCK_METHOD(void, | ||
ResizeSurface, | ||
(WindowsRenderTarget*, EGLint, EGLint, bool), | ||
(override)); | ||
MOCK_METHOD(void, DestroySurface, (), (override)); | ||
|
||
MOCK_METHOD(bool, MakeCurrent, (), (override)); | ||
MOCK_METHOD(bool, ClearCurrent, (), (override)); | ||
MOCK_METHOD(void, SetVSyncEnabled, (bool), (override)); | ||
|
||
private: | ||
FML_DISALLOW_COPY_AND_ASSIGN(MockAngleSurfaceManager); | ||
}; | ||
|
||
} // namespace testing | ||
} // namespace flutter | ||
|
||
#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_ANGLE_SURFACE_MANAGER_H_ |