Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion fml/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ if (enable_unittests) {
deps = [
":fml_fixtures",
"//flutter/fml",
"//flutter/fml/dart",
"//flutter/runtime",
"//flutter/runtime:libdart",
"//flutter/testing",
Expand Down
19 changes: 0 additions & 19 deletions fml/dart/BUILD.gn

This file was deleted.

11 changes: 0 additions & 11 deletions fml/dart/dart_converter.cc

This file was deleted.

127 changes: 0 additions & 127 deletions fml/dart/dart_converter.h

This file was deleted.

1 change: 0 additions & 1 deletion shell/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ if (enable_unittests) {
public_deps = [
"//flutter/common/graphics",
"//flutter/flow",
"//flutter/fml/dart",
"//flutter/runtime",
"//flutter/shell/common",
"//flutter/testing",
Expand Down
23 changes: 0 additions & 23 deletions shell/common/fixtures/shell_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,29 +220,6 @@ void callNotifyDestroyed() {
@pragma('vm:external-name', 'NotifyMessage')
external void notifyMessage(String string);

@pragma('vm:entry-point')
void canConvertMappings() {
sendFixtureMapping(getFixtureMapping());
}

@pragma('vm:external-name', 'GetFixtureMapping')
external List<int> getFixtureMapping();
@pragma('vm:external-name', 'SendFixtureMapping')
external void sendFixtureMapping(List<int> list);

@pragma('vm:entry-point')
void canDecompressImageFromAsset() {
decodeImageFromList(
Uint8List.fromList(getFixtureImage()),
(Image result) {
notifyWidthHeight(result.width, result.height);
},
);
}

@pragma('vm:external-name', 'GetFixtureImage')
external List<int> getFixtureImage();

@pragma('vm:entry-point')
void canRegisterImageDecoders() {
decodeImageFromList(
Expand Down
1 change: 0 additions & 1 deletion shell/common/shell_fuchsia_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <fuchsia/settings/cpp/fidl.h>
#include <lib/sys/cpp/component_context.h>

#include "flutter/fml/dart/dart_converter.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/synchronization/count_down_latch.h"
#include "flutter/runtime/dart_vm.h"
Expand Down
76 changes: 0 additions & 76 deletions shell/common/shell_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "flutter/flow/layers/transform_layer.h"
#include "flutter/fml/backtrace.h"
#include "flutter/fml/command_line.h"
#include "flutter/fml/dart/dart_converter.h"
#include "flutter/fml/make_copyable.h"
#include "flutter/fml/message_loop.h"
#include "flutter/fml/synchronization/count_down_latch.h"
Expand Down Expand Up @@ -2207,52 +2206,6 @@ TEST_F(ShellTest, Screenshot) {
DestroyShell(std::move(shell));
}

TEST_F(ShellTest, CanConvertToAndFromMappings) {
const size_t buffer_size = 2 << 20;

uint8_t* buffer = static_cast<uint8_t*>(::malloc(buffer_size));
// NOLINTNEXTLINE(clang-analyzer-unix.Malloc)
ASSERT_TRUE(buffer != nullptr);
ASSERT_TRUE(MemsetPatternSetOrCheck(
buffer, buffer_size, MemsetPatternOp::kMemsetPatternOpSetBuffer));

std::unique_ptr<fml::Mapping> mapping =
std::make_unique<fml::MallocMapping>(buffer, buffer_size);

ASSERT_EQ(mapping->GetSize(), buffer_size);

fml::AutoResetWaitableEvent latch;
AddNativeCallback(
"SendFixtureMapping", CREATE_NATIVE_ENTRY([&](auto args) {
auto mapping_from_dart =
tonic::DartConverter<std::unique_ptr<fml::Mapping>>::FromDart(
Dart_GetNativeArgument(args, 0));
ASSERT_NE(mapping_from_dart, nullptr);
ASSERT_EQ(mapping_from_dart->GetSize(), buffer_size);
ASSERT_TRUE(MemsetPatternSetOrCheck(
const_cast<uint8_t*>(mapping_from_dart->GetMapping()), // buffer
mapping_from_dart->GetSize(), // size
MemsetPatternOp::kMemsetPatternOpCheckBuffer // op
));
latch.Signal();
}));

AddNativeCallback(
"GetFixtureMapping", CREATE_NATIVE_ENTRY([&](auto args) {
tonic::DartConverter<tonic::DartConverterMapping>::SetReturnValue(
args, mapping);
}));

auto settings = CreateSettingsForFixture();
auto configuration = RunConfiguration::InferFromSettings(settings);
configuration.SetEntrypoint("canConvertMappings");
std::unique_ptr<Shell> shell = CreateShell(settings);
ASSERT_NE(shell.get(), nullptr);
RunEngine(shell.get(), std::move(configuration));
latch.Wait();
DestroyShell(std::move(shell));
}

// Compares local times as seen by the dart isolate and as seen by this test
// fixture, to a resolution of 1 hour.
//
Expand Down Expand Up @@ -2301,35 +2254,6 @@ TEST_F(ShellTest, LocaltimesMatch) {
DestroyShell(std::move(shell));
}

TEST_F(ShellTest, CanDecompressImageFromAsset) {
fml::AutoResetWaitableEvent latch;
AddNativeCallback("NotifyWidthHeight", CREATE_NATIVE_ENTRY([&](auto args) {
auto width = tonic::DartConverter<int>::FromDart(
Dart_GetNativeArgument(args, 0));
auto height = tonic::DartConverter<int>::FromDart(
Dart_GetNativeArgument(args, 1));
ASSERT_EQ(width, 100);
ASSERT_EQ(height, 100);
latch.Signal();
}));

AddNativeCallback(
"GetFixtureImage", CREATE_NATIVE_ENTRY([](auto args) {
auto fixture = OpenFixtureAsMapping("shelltest_screenshot.png");
tonic::DartConverter<tonic::DartConverterMapping>::SetReturnValue(
args, fixture);
}));

auto settings = CreateSettingsForFixture();
auto configuration = RunConfiguration::InferFromSettings(settings);
configuration.SetEntrypoint("canDecompressImageFromAsset");
std::unique_ptr<Shell> shell = CreateShell(settings);
ASSERT_NE(shell.get(), nullptr);
RunEngine(shell.get(), std::move(configuration));
latch.Wait();
DestroyShell(std::move(shell));
}

/// An image generator that always creates a 1x1 single-frame green image.
class SinglePixelImageGenerator : public ImageGenerator {
public:
Expand Down