• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef FLUTTER_RUNTIME_RUNTIME_TEST_H_
6 #define FLUTTER_RUNTIME_RUNTIME_TEST_H_
7 
8 #include <memory>
9 
10 #include "flutter/common/settings.h"
11 #include "flutter/fml/macros.h"
12 #include "flutter/testing/test_dart_native_resolver.h"
13 #include "flutter/testing/thread_test.h"
14 
15 namespace flutter {
16 namespace testing {
17 
18 class RuntimeTest : public ThreadTest {
19  public:
20   RuntimeTest();
21 
22   ~RuntimeTest();
23 
24   Settings CreateSettingsForFixture();
25 
26   void AddNativeCallback(std::string name, Dart_NativeFunction callback);
27 
28  protected:
29   // |testing::ThreadTest|
30   void SetUp() override;
31 
32   // |testing::ThreadTest|
33   void TearDown() override;
34 
35  private:
36   fml::UniqueFD assets_dir_;
37   std::shared_ptr<TestDartNativeResolver> native_resolver_;
38 
39   void SetSnapshotsAndAssets(Settings& settings);
40 };
41 
42 }  // namespace testing
43 }  // namespace flutter
44 
45 #endif  // FLUTTER_RUNTIME_RUNTIME_TEST_H_
46