Cleanup unused code in the UIDartState and other tests. (flutter/engine#31152)
This commit is contained in:
@@ -11,8 +11,6 @@ namespace testing {
|
||||
|
||||
FML_THREAD_LOCAL fml::ThreadLocalUniquePtr<int> current_context;
|
||||
|
||||
GLContextSwitchTest::GLContextSwitchTest() = default;
|
||||
|
||||
TestSwitchableGLContext::TestSwitchableGLContext(int context)
|
||||
: context_(context){};
|
||||
|
||||
|
||||
@@ -11,11 +11,6 @@
|
||||
namespace flutter {
|
||||
namespace testing {
|
||||
|
||||
class GLContextSwitchTest : public ::testing::Test {
|
||||
public:
|
||||
GLContextSwitchTest();
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// The renderer context used for testing
|
||||
class TestSwitchableGLContext : public SwitchableGLContext {
|
||||
|
||||
@@ -79,10 +79,6 @@ const std::string& UIDartState::GetAdvisoryScriptURI() const {
|
||||
return context_.advisory_script_uri;
|
||||
}
|
||||
|
||||
const std::string& UIDartState::GetAdvisoryScriptEntrypoint() const {
|
||||
return context_.advisory_script_entrypoint;
|
||||
}
|
||||
|
||||
void UIDartState::DidSetIsolate() {
|
||||
main_port_ = Dart_GetMainPortId();
|
||||
std::ostringstream debug_name;
|
||||
@@ -169,13 +165,6 @@ fml::WeakPtr<SnapshotDelegate> UIDartState::GetSnapshotDelegate() const {
|
||||
return context_.snapshot_delegate;
|
||||
}
|
||||
|
||||
fml::WeakPtr<GrDirectContext> UIDartState::GetResourceContext() const {
|
||||
if (!context_.io_manager) {
|
||||
return {};
|
||||
}
|
||||
return context_.io_manager->GetResourceContext();
|
||||
}
|
||||
|
||||
fml::WeakPtr<ImageDecoder> UIDartState::GetImageDecoder() const {
|
||||
return context_.image_decoder;
|
||||
}
|
||||
|
||||
@@ -120,8 +120,6 @@ class UIDartState : public tonic::DartState {
|
||||
|
||||
fml::WeakPtr<SnapshotDelegate> GetSnapshotDelegate() const;
|
||||
|
||||
fml::WeakPtr<GrDirectContext> GetResourceContext() const;
|
||||
|
||||
fml::WeakPtr<ImageDecoder> GetImageDecoder() const;
|
||||
|
||||
fml::WeakPtr<ImageGeneratorRegistry> GetImageGeneratorRegistry() const;
|
||||
@@ -175,8 +173,6 @@ class UIDartState : public tonic::DartState {
|
||||
|
||||
const std::string& GetAdvisoryScriptURI() const;
|
||||
|
||||
const std::string& GetAdvisoryScriptEntrypoint() const;
|
||||
|
||||
private:
|
||||
void DidSetIsolate() override;
|
||||
|
||||
|
||||
@@ -19,35 +19,6 @@
|
||||
namespace flutter {
|
||||
namespace testing {
|
||||
|
||||
class DummyPlatformConfigurationClient : public PlatformConfigurationClient {
|
||||
public:
|
||||
DummyPlatformConfigurationClient() {
|
||||
std::vector<uint8_t> data;
|
||||
isolate_data_.reset(new ::fml::DataMapping(data));
|
||||
}
|
||||
std::string DefaultRouteName() override { return "TestRoute"; }
|
||||
void ScheduleFrame() override {}
|
||||
void Render(Scene* scene) override {}
|
||||
void UpdateSemantics(SemanticsUpdate* update) override {}
|
||||
void HandlePlatformMessage(
|
||||
std::unique_ptr<PlatformMessage> message) override {}
|
||||
FontCollection& GetFontCollection() override { return font_collection_; }
|
||||
void UpdateIsolateDescription(const std::string isolate_name,
|
||||
int64_t isolate_port) override {}
|
||||
void SetNeedsReportTimings(bool value) override {}
|
||||
std::shared_ptr<const fml::Mapping> GetPersistentIsolateData() override {
|
||||
return isolate_data_;
|
||||
}
|
||||
std::unique_ptr<std::vector<std::string>> ComputePlatformResolvedLocale(
|
||||
const std::vector<std::string>& supported_locale_data) override {
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
private:
|
||||
FontCollection font_collection_;
|
||||
std::shared_ptr<const fml::Mapping> isolate_data_;
|
||||
};
|
||||
|
||||
TEST_F(ShellTest, PlatformConfigurationInitialization) {
|
||||
auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
|
||||
|
||||
|
||||
@@ -1390,10 +1390,6 @@ std::vector<std::unique_ptr<SkStreamAsset>> GetTestFontData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
std::string GetTestFontFamilyName() {
|
||||
return "Ahem";
|
||||
}
|
||||
|
||||
std::vector<std::string> GetTestFontFamilyNames() {
|
||||
std::vector<std::string> names = {"Ahem", "Cough"};
|
||||
return names;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
namespace flutter {
|
||||
|
||||
std::vector<std::unique_ptr<SkStreamAsset>> GetTestFontData();
|
||||
std::string GetTestFontFamilyName();
|
||||
std::vector<std::string> GetTestFontFamilyNames();
|
||||
|
||||
} // namespace flutter
|
||||
|
||||
Reference in New Issue
Block a user