Hold the TestRunner's platform view through a shared_ptr (flutter/engine#3870)

flutter_tester was throwing a bad_weak_ptr while setting up the engine
because the PlatformViewTest was held in a unique_ptr
This commit is contained in:
Jason Simmons
2017-07-12 16:37:47 -07:00
committed by GitHub
parent e1232ee771
commit a17f541da0
2 changed files with 2 additions and 2 deletions

View File

@@ -13,7 +13,7 @@
namespace shell {
TestRunner::TestRunner() : platform_view_(std::make_unique<PlatformViewTest>()) {
TestRunner::TestRunner() : platform_view_(std::make_shared<PlatformViewTest>()) {
platform_view_->Attach();
blink::ViewportMetrics metrics;
metrics.device_pixel_ratio = 3.0;

View File

@@ -32,7 +32,7 @@ class TestRunner {
TestRunner();
~TestRunner();
std::unique_ptr<PlatformView> platform_view_;
std::shared_ptr<PlatformView> platform_view_;
FTL_DISALLOW_COPY_AND_ASSIGN(TestRunner);
};