Skip to content

Commit

Permalink
Use software renderer in embedder unittests (flutter#6928)
Browse files Browse the repository at this point in the history
Reduces spurious error log messages in GLContextMakeCurrent() attempting
set up the GR context:

  [ERROR:flutter/shell/gpu/gpu_surface_gl.cc(42)] Could not make the context current to setup the gr context.
  • Loading branch information
cbracken authored Nov 26, 2018
1 parent 99e73d8 commit 25d99cd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions shell/platform/embedder/tests/embedder_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ TEST(EmbedderTest, MustNotRunWithInvalidArgs) {
}

TEST(EmbedderTest, CanLaunchAndShutdownWithValidProjectArgs) {
FlutterOpenGLRendererConfig renderer = {};
renderer.struct_size = sizeof(FlutterOpenGLRendererConfig);
renderer.make_current = [](void*) { return false; };
renderer.clear_current = [](void*) { return false; };
renderer.present = [](void*) { return false; };
renderer.fbo_callback = [](void*) -> uint32_t { return 0; };
FlutterSoftwareRendererConfig renderer;
renderer.struct_size = sizeof(FlutterSoftwareRendererConfig);
renderer.surface_present_callback = [](void*, const void*, size_t, size_t) {
return false;
};

std::string main =
std::string(testing::GetFixturesPath()) + "/simple_main.dart";

FlutterRendererConfig config = {};
config.type = FlutterRendererType::kOpenGL;
config.open_gl = renderer;
config.type = FlutterRendererType::kSoftware;
config.software = renderer;

FlutterProjectArgs args = {};
args.struct_size = sizeof(FlutterProjectArgs);
Expand Down

0 comments on commit 25d99cd

Please sign in to comment.