151 {
155 auto environment = fml::MakeRefCounted<AndroidEnvironmentGL>();
156 std::string thread_label =
157 ::testing::UnitTest::GetInstance()->current_test_info()->name();
160 ThreadHost::Type::kIo));
161 TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host);
162 auto android_context =
163 std::make_shared<AndroidContextGLSkia>(
environment, task_runners);
164 auto android_surface =
165 std::make_unique<AndroidSurfaceGLSkia>(android_context);
166 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
167 nullptr, true);
168 android_surface->SetNativeWindow(
window);
169 auto onscreen_surface = android_surface->GetOnscreenSurface();
170 EXPECT_NE(onscreen_surface, nullptr);
171 android_surface->CreateSnapshotSurface();
172 EXPECT_EQ(onscreen_surface, android_surface->GetOnscreenSurface());
173}