#include #include #include #include #include #include #include #include #include "window_ext_plugin.h" namespace window_ext { namespace test { namespace { using flutter::EncodableMap; using flutter::EncodableValue; using flutter::MethodCall; using flutter::MethodResultFunctions; } // namespace TEST(WindowExtPlugin, GetPlatformVersion) { WindowExtPlugin plugin; // Save the reply value from the success callback. std::string result_string; plugin.HandleMethodCall( MethodCall("getPlatformVersion", std::make_unique()), std::make_unique>( [&result_string](const EncodableValue* result) { result_string = std::get(*result); }, nullptr, nullptr)); // Since the exact string varies by host, just ensure that it's a string // with the expected format. EXPECT_TRUE(result_string.rfind("Windows ", 0) == 0); } } // namespace test } // namespace window_ext