9 #include "flutter/shell/platform/windows/client_wrapper/testing/stub_flutter_windows_api.h"
10 #include "gtest/gtest.h"
17 class TestWindowsApi :
public testing::StubFlutterWindowsApi {
18 HWND ViewGetHWND()
override {
return reinterpret_cast<HWND
>(7); }
20 IDXGIAdapter* ViewGetGraphicsAdapter()
override {
21 return reinterpret_cast<IDXGIAdapter*
>(8);
27 TEST(FlutterViewTest, HwndAccessPassesThrough) {
28 testing::ScopedStubFlutterWindowsApi scoped_api_stub(
29 std::make_unique<TestWindowsApi>());
30 auto test_api =
static_cast<TestWindowsApi*
>(scoped_api_stub.stub());
35 TEST(FlutterViewTest, GraphicsAdapterAccessPassesThrough) {
36 testing::ScopedStubFlutterWindowsApi scoped_api_stub(
37 std::make_unique<TestWindowsApi>());
38 auto test_api =
static_cast<TestWindowsApi*
>(scoped_api_stub.stub());
42 EXPECT_EQ(adapter,
reinterpret_cast<IDXGIAdapter*
>(8));