wl_base_help_plugin_test.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include <flutter/method_call.h>
  2. #include <flutter/method_result_functions.h>
  3. #include <flutter/standard_method_codec.h>
  4. #include <gtest/gtest.h>
  5. #include <windows.h>
  6. #include <memory>
  7. #include <string>
  8. #include <variant>
  9. #include "wl_base_help_plugin.h"
  10. namespace wl_base_help {
  11. namespace test {
  12. namespace {
  13. using flutter::EncodableMap;
  14. using flutter::EncodableValue;
  15. using flutter::MethodCall;
  16. using flutter::MethodResultFunctions;
  17. } // namespace
  18. TEST(WlBaseHelpPlugin, GetPlatformVersion) {
  19. // WlBaseHelpPlugin plugin;
  20. // // Save the reply value from the success callback.
  21. // std::string result_string;
  22. // plugin.HandleMethodCall(
  23. // MethodCall("getPlatformVersion", std::make_unique<EncodableValue>()),
  24. // std::make_unique<MethodResultFunctions<>>(
  25. // [&result_string](const EncodableValue* result) {
  26. // result_string = std::get<std::string>(*result);
  27. // },
  28. // nullptr, nullptr));
  29. //
  30. // // Since the exact string varies by host, just ensure that it's a string
  31. // // with the expected format.
  32. // EXPECT_TRUE(result_string.rfind("Windows ", 0) == 0);
  33. }
  34. } // namespace test
  35. } // namespace wl_base_help