| // 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. |
| |
| #include <memory> |
| #include <string> |
| |
| #include "flutter/shell/platform/windows/client_wrapper/include/flutter/plugin_registrar_windows.h" |
| #include "flutter/shell/platform/windows/client_wrapper/testing/stub_flutter_windows_api.h" |
| #include "gtest/gtest.h" |
| |
| namespace flutter { |
| |
| namespace { |
| |
| // Stub implementation to validate calls to the API. |
| class TestWindowsApi : public testing::StubFlutterWindowsApi {}; |
| |
| } // namespace |
| |
| TEST(PluginRegistrarWindowsTest, GetView) { |
| testing::ScopedStubFlutterWindowsApi scoped_api_stub( |
| std::make_unique<TestWindowsApi>()); |
| auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub()); |
| PluginRegistrarWindows registrar( |
| reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1)); |
| EXPECT_NE(registrar.GetView(), nullptr); |
| } |
| |
| } // namespace flutter |