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" )
65import (" //flutter/shell/gpu/gpu.gni" )
76import (" //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" ) {
0 commit comments