mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
The shell was already designed to cleanly shut down the VM but it couldnt earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This meant that shutting down an engine instance could not shut down the VM to save memory because newly created engines in the process after that point couldn't restart the VM. There can only be one VM running in a process at a time. This patch separate the previous DartVM object into one that references a running instance of the DartVM and a set of immutable dependencies that components can reference even as the VM is shutting down. Unit tests have been added to assert that non-overlapping engine launches use difference VM instances.
24 lines
570 B
C++
24 lines
570 B
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef TESTING_TESTING_H_
|
|
#define TESTING_TESTING_H_
|
|
|
|
#include <string>
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace testing {
|
|
|
|
// Returns the directory containing the test fixture for the target if this
|
|
// target has fixtures configured. If there are no fixtures, this is a link
|
|
// error.
|
|
const char* GetFixturesPath();
|
|
|
|
std::string GetCurrentTestName();
|
|
|
|
} // namespace testing
|
|
|
|
#endif // TESTING_TESTING_H_
|