8#include "flutter/shell/platform/glfw/client_wrapper/include/flutter/flutter_engine.h"
9#include "flutter/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.h"
10#include "gtest/gtest.h"
17class TestGlfwApi :
public testing::StubFlutterGlfwApi {
27 void RunEngineEventLoopWithTimeout(uint32_t millisecond_timeout)
override {
28 last_run_loop_timeout_ = millisecond_timeout;
32 bool ShutDownEngine()
override {
33 shut_down_called_ =
true;
37 bool run_called() {
return run_called_; }
39 bool shut_down_called() {
return shut_down_called_; }
41 uint32_t last_run_loop_timeout() {
return last_run_loop_timeout_; }
44 bool run_called_ =
false;
45 bool shut_down_called_ =
false;
46 uint32_t last_run_loop_timeout_ = 0;
52 const std::string icu_data_path =
"fake/path/to/icu";
53 const std::string assets_path =
"fake/path/to/assets";
55 std::make_unique<TestGlfwApi>());
56 auto test_api =
static_cast<TestGlfwApi*
>(scoped_api_stub.
stub());
60 EXPECT_EQ(test_api->run_called(),
true);
61 EXPECT_EQ(test_api->shut_down_called(),
false);
64 EXPECT_EQ(test_api->shut_down_called(),
true);
68 const std::string icu_data_path =
"fake/path/to/icu";
69 const std::string assets_path =
"fake/path/to/assets";
71 std::make_unique<TestGlfwApi>());
72 auto test_api =
static_cast<TestGlfwApi*
>(scoped_api_stub.
stub());
76 EXPECT_EQ(test_api->run_called(),
true);
77 EXPECT_EQ(test_api->shut_down_called(),
false);
79 EXPECT_EQ(test_api->shut_down_called(),
true);
83 const std::string icu_data_path =
"fake/path/to/icu";
84 const std::string assets_path =
"fake/path/to/assets";
86 std::make_unique<TestGlfwApi>());
87 auto test_api =
static_cast<TestGlfwApi*
>(scoped_api_stub.
stub());
93 EXPECT_EQ(test_api->last_run_loop_timeout(), 100U);
96 std::chrono::milliseconds(1));
97 EXPECT_EQ(test_api->last_run_loop_timeout(), UINT32_MAX);
100 EXPECT_EQ(test_api->last_run_loop_timeout(), 0
U);
bool Start(const std::string &icu_data_path, const std::string &assets_path, const std::vector< std::string > &arguments, const std::string &aot_library_path="")
void RunEventLoopWithTimeout(std::chrono::milliseconds timeout=std::chrono::milliseconds::max())
StubFlutterGlfwApi * stub()
static float max(float r, float g, float b)
TEST(FrameTimingsRecorderTest, RecordVsync)