Skip to content

Commit c366c00

Browse files
authored
Revert "Enable shell_unittests on Fuchsia with Vulkan dependencies. (flutter#16376)"
This reverts commit 9d60825.
1 parent cb4570b commit c366c00

File tree

16 files changed

+86
-327
lines changed

16 files changed

+86
-327
lines changed

BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ if (is_fuchsia) {
136136
"//flutter/flow:flow_tests",
137137
"//flutter/fml:fml_tests",
138138
"//flutter/runtime:runtime_tests",
139-
"//flutter/shell/common:shell_tests",
140139
"//flutter/shell/platform/fuchsia/flutter:flutter_runner_scenic_tests",
141140
"//flutter/shell/platform/fuchsia/flutter:flutter_runner_tests",
142141
]

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,6 @@ FILE: ../../../flutter/shell/common/shell_test_platform_view.cc
578578
FILE: ../../../flutter/shell/common/shell_test_platform_view.h
579579
FILE: ../../../flutter/shell/common/shell_test_platform_view_gl.cc
580580
FILE: ../../../flutter/shell/common/shell_test_platform_view_gl.h
581-
FILE: ../../../flutter/shell/common/shell_test_platform_view_vulkan.cc
582-
FILE: ../../../flutter/shell/common/shell_test_platform_view_vulkan.h
583581
FILE: ../../../flutter/shell/common/shell_unittests.cc
584582
FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc
585583
FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h

shell/common/BUILD.gn

Lines changed: 8 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,9 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5-
import("//flutter/common/config.gni")
65
import("//flutter/shell/gpu/gpu.gni")
76
import("//flutter/testing/testing.gni")
87

9-
if (is_fuchsia) {
10-
import("//build/fuchsia/sdk.gni")
11-
import("//flutter/tools/fuchsia/fuchsia_archive.gni")
12-
}
13-
14-
config("vulkan_config") {
15-
if (using_fuchsia_sdk) {
16-
include_dirs = [ "$fuchsia_sdk_root/vulkan/include" ]
17-
} else if (is_fuchsia) {
18-
include_dirs =
19-
[ "//third_party/vulkan_loader_and_validation_layers/include" ]
20-
} else {
21-
include_dirs = [ "//third_party/vulkan/src" ]
22-
}
23-
24-
if (is_fuchsia) {
25-
defines = [ "VK_USE_PLATFORM_FUCHSIA=1" ]
26-
}
27-
}
28-
298
# Template to generate a dart embedder resource.cc file.
309
# Required invoker inputs:
3110
# String output (name of output file)
@@ -164,19 +143,12 @@ template("shell_host_executable") {
164143
}
165144
}
166145

167-
if (enable_unittests) {
168-
declare_args() {
169-
test_enable_vulkan = is_fuchsia
170-
test_enable_gl = !is_fuchsia
171-
test_enable_software = true
172-
test_enable_metal = false
173-
}
174-
146+
if (current_toolchain == host_toolchain) {
175147
shell_gpu_configuration("shell_unittests_gpu_configuration") {
176-
enable_software = test_enable_software
177-
enable_vulkan = test_enable_vulkan
178-
enable_gl = test_enable_gl
179-
enable_metal = test_enable_metal
148+
enable_software = true
149+
enable_vulkan = false
150+
enable_gl = true
151+
enable_metal = false
180152
}
181153

182154
test_fixtures("shell_unittests_fixtures") {
@@ -196,6 +168,8 @@ if (enable_unittests) {
196168
"shell_test.h",
197169
"shell_test_platform_view.cc",
198170
"shell_test_platform_view.h",
171+
"shell_test_platform_view_gl.cc",
172+
"shell_test_platform_view_gl.h",
199173
"shell_unittests.cc",
200174
"vsync_waiters_test.cc",
201175
"vsync_waiters_test.h",
@@ -210,64 +184,8 @@ if (enable_unittests) {
210184
"//flutter/lib/ui:ui",
211185
"//flutter/shell",
212186
"//flutter/testing:dart",
187+
"//flutter/testing:opengl",
213188
]
214-
215-
if (!defined(defines)) {
216-
defines = []
217-
}
218-
219-
# SwiftShader only supports x86/x64_64
220-
if (target_cpu == "x86" || target_cpu == "x64") {
221-
if (test_enable_gl) {
222-
sources += [
223-
"shell_test_platform_view_gl.cc",
224-
"shell_test_platform_view_gl.h",
225-
]
226-
227-
deps += [ "//flutter/testing:opengl" ]
228-
229-
defines += [ "SHELL_ENABLE_GL" ]
230-
}
231-
232-
if (test_enable_vulkan) {
233-
sources += [
234-
"shell_test_platform_view_vulkan.cc",
235-
"shell_test_platform_view_vulkan.h",
236-
]
237-
238-
deps += [
239-
"//flutter/testing:vulkan",
240-
"//flutter/vulkan",
241-
]
242-
243-
defines += [ "SHELL_ENABLE_VULKAN" ]
244-
}
245-
}
246-
}
247-
248-
if (is_fuchsia) {
249-
fuchsia_test_archive("shell_tests") {
250-
deps = [
251-
":shell_unittests",
252-
":shell_unittests_fixtures",
253-
]
254-
255-
binary = "shell_unittests"
256-
257-
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
258-
# Right now we need to manually specify all the fixtures that are
259-
# declared in the test_fixtures() call above.
260-
resources = [
261-
{
262-
path = "$target_gen_dir/assets/kernel_blob.bin"
263-
dest = "assets/kernel_blob.bin"
264-
},
265-
{
266-
path = "$target_gen_dir/assets/shelltest_screenshot.png"
267-
dest = "assets/shelltest_screenshot.png"
268-
},
269-
]
270-
}
271189
}
272190

273191
shell_host_executable("shell_benchmarks") {

shell/common/animator_unittests.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ TEST_F(ShellTest, VSyncTargetTime) {
5252
shell = Shell::Create(
5353
task_runners, settings,
5454
[vsync_clock, &create_vsync_waiter](Shell& shell) {
55-
return ShellTestPlatformView::Create(
56-
shell, shell.GetTaskRunners(), vsync_clock,
57-
std::move(create_vsync_waiter),
58-
ShellTestPlatformView::BackendType::kDefaultBackend);
55+
return ShellTestPlatformView::Create(shell, shell.GetTaskRunners(),
56+
vsync_clock,
57+
std::move(create_vsync_waiter));
5958
},
6059
[](Shell& shell) {
6160
return std::make_unique<Rasterizer>(shell, shell.GetTaskRunners());

shell/common/shell_test.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,9 @@ std::unique_ptr<Shell> ShellTest::CreateShell(Settings settings,
254254
return Shell::Create(
255255
task_runners, settings,
256256
[vsync_clock, &create_vsync_waiter](Shell& shell) {
257-
return ShellTestPlatformView::Create(
258-
shell, shell.GetTaskRunners(), vsync_clock,
259-
std::move(create_vsync_waiter),
260-
ShellTestPlatformView::BackendType::kDefaultBackend);
257+
return ShellTestPlatformView::Create(shell, shell.GetTaskRunners(),
258+
vsync_clock,
259+
std::move(create_vsync_waiter));
261260
},
262261
[](Shell& shell) {
263262
return std::make_unique<Rasterizer>(shell, shell.GetTaskRunners());

shell/common/shell_test_platform_view.cc

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "flutter/shell/common/shell_test_platform_view.h"
6-
7-
#ifdef SHELL_ENABLE_GL
86
#include "flutter/shell/common/shell_test_platform_view_gl.h"
9-
#endif // SHELL_ENABLE_GL
10-
#ifdef SHELL_ENABLE_VULKAN
11-
#include "flutter/shell/common/shell_test_platform_view_vulkan.h"
12-
#endif // SHELL_ENABLE_VULKAN
137

148
namespace flutter {
159
namespace testing {
@@ -18,26 +12,9 @@ std::unique_ptr<ShellTestPlatformView> ShellTestPlatformView::Create(
1812
PlatformView::Delegate& delegate,
1913
TaskRunners task_runners,
2014
std::shared_ptr<ShellTestVsyncClock> vsync_clock,
21-
CreateVsyncWaiter create_vsync_waiter,
22-
BackendType backend) {
23-
// TODO(gw280): https://github.com/flutter/flutter/issues/50298
24-
// Make this fully runtime configurable
25-
switch (backend) {
26-
case BackendType::kDefaultBackend:
27-
#ifdef SHELL_ENABLE_GL
28-
case BackendType::kGLBackend:
29-
return std::make_unique<ShellTestPlatformViewGL>(
30-
delegate, task_runners, vsync_clock, create_vsync_waiter);
31-
#endif // SHELL_ENABLE_GL
32-
#ifdef SHELL_ENABLE_VULKAN
33-
case BackendType::kVulkanBackend:
34-
return std::make_unique<ShellTestPlatformViewVulkan>(
35-
delegate, task_runners, vsync_clock, create_vsync_waiter);
36-
#endif // SHELL_ENABLE_VULKAN
37-
default:
38-
FML_LOG(FATAL) << "No backends supported for ShellTestPlatformView";
39-
return nullptr;
40-
}
15+
CreateVsyncWaiter create_vsync_waiter) {
16+
return std::make_unique<ShellTestPlatformViewGL>(
17+
delegate, task_runners, vsync_clock, create_vsync_waiter);
4118
}
4219

4320
} // namespace testing

shell/common/shell_test_platform_view.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,11 @@ namespace testing {
1313

1414
class ShellTestPlatformView : public PlatformView {
1515
public:
16-
enum class BackendType {
17-
kGLBackend,
18-
kVulkanBackend,
19-
kDefaultBackend,
20-
};
21-
2216
static std::unique_ptr<ShellTestPlatformView> Create(
2317
PlatformView::Delegate& delegate,
2418
TaskRunners task_runners,
2519
std::shared_ptr<ShellTestVsyncClock> vsync_clock,
26-
CreateVsyncWaiter create_vsync_waiter,
27-
BackendType backend);
20+
CreateVsyncWaiter create_vsync_waiter);
2821

2922
virtual void SimulateVSync() = 0;
3023

shell/common/shell_test_platform_view_vulkan.cc

Lines changed: 0 additions & 49 deletions
This file was deleted.

shell/common/shell_test_platform_view_vulkan.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

shell/common/shell_unittests.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ TEST_F(ShellTest,
135135
[task_runners = shell.GetTaskRunners()]() {
136136
return static_cast<std::unique_ptr<VsyncWaiter>>(
137137
std::make_unique<VsyncWaiterFallback>(task_runners));
138-
},
139-
ShellTestPlatformView::BackendType::kDefaultBackend);
138+
});
140139
},
141140
[](Shell& shell) {
142141
return std::make_unique<Rasterizer>(shell, shell.GetTaskRunners());

0 commit comments

Comments
 (0)