1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "flutter/shell/platform/embedder/tests/embedder_test.h" 6 7 namespace flutter { 8 namespace testing { 9 10 EmbedderTest::EmbedderTest() = default; 11 12 EmbedderTest::~EmbedderTest() = default; 13 GetFixturesDirectory() const14std::string EmbedderTest::GetFixturesDirectory() const { 15 return GetFixturesPath(); 16 } 17 GetEmbedderContext()18EmbedderTestContext& EmbedderTest::GetEmbedderContext() { 19 // Setup the embedder context lazily instead of in the SetUp method because we 20 // don't to do all the work if the test won't end up using context. 21 if (!embedder_context_) { 22 embedder_context_ = 23 std::make_unique<EmbedderTestContext>(GetFixturesDirectory()); 24 } 25 return *embedder_context_; 26 } 27 28 // |testing::Test| SetUp()29void EmbedderTest::SetUp() { 30 ThreadTest::SetUp(); 31 } 32 33 // |testing::Test| TearDown()34void EmbedderTest::TearDown() { 35 embedder_context_.reset(); 36 ThreadTest::TearDown(); 37 } 38 39 } // namespace testing 40 } // namespace flutter 41