8#include "flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_view_controller.h"
9#include "flutter/shell/platform/windows/client_wrapper/testing/stub_flutter_windows_api.h"
10#include "gtest/gtest.h"
17class TestWindowsApi :
public testing::StubFlutterWindowsApi {
28 void ViewControllerDestroy()
override { view_controller_destroyed_ =
true; }
31 void ViewControllerForceRedraw()
override {
32 view_controller_force_redrawed_ =
true;
42 bool EngineDestroy()
override {
43 engine_destroyed_ =
true;
47 bool engine_destroyed() {
return engine_destroyed_; }
48 bool view_controller_destroyed() {
return view_controller_destroyed_; }
49 bool view_controller_force_redrawed() {
50 return view_controller_force_redrawed_;
54 bool engine_destroyed_ =
false;
55 bool view_controller_destroyed_ =
false;
56 bool view_controller_force_redrawed_ =
false;
62 DartProject project(
L"data");
63 testing::ScopedStubFlutterWindowsApi scoped_api_stub(
64 std::make_unique<TestWindowsApi>());
65 auto test_api =
static_cast<TestWindowsApi*
>(scoped_api_stub.stub());
70 EXPECT_FALSE(test_api->engine_destroyed());
76 std::make_unique<TestWindowsApi>());
77 auto test_api =
static_cast<TestWindowsApi*
>(scoped_api_stub.
stub());
79 EXPECT_EQ(controller.
view_id(), 1);
85 std::make_unique<TestWindowsApi>());
86 auto test_api =
static_cast<TestWindowsApi*
>(scoped_api_stub.
stub());
88 EXPECT_NE(controller.
engine(),
nullptr);
94 std::make_unique<TestWindowsApi>());
95 auto test_api =
static_cast<TestWindowsApi*
>(scoped_api_stub.
stub());
97 EXPECT_NE(controller.
view(),
nullptr);
103 std::make_unique<TestWindowsApi>());
104 auto test_api =
static_cast<TestWindowsApi*
>(scoped_api_stub.
stub());
108 EXPECT_TRUE(test_api->view_controller_force_redrawed());
FlutterView * view() const
FlutterEngine * engine() const
FlutterViewId view_id() const
StubFlutterWindowsApi * stub()
struct FlutterDesktopViewController * FlutterDesktopViewControllerRef
TEST(FrameTimingsRecorderTest, RecordVsync)
#define EXPECT_TRUE(handle)