Flutter Engine
The Flutter Engine
shell
platform
android
platform_view_android_unittests.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "gmock/gmock.h"
6
#include "gtest/gtest.h"
7
#include "
shell/platform/android/flutter_main.h
"
8
#include "third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h"
9
10
namespace
flutter
{
11
namespace
testing {
12
13
TEST
(AndroidPlatformView, SelectsVulkanBasedOnApiLevel) {
14
Settings
settings
;
15
settings
.enable_software_rendering =
false
;
16
settings
.enable_impeller =
true
;
17
18
int
api_level = android_get_device_api_level();
19
EXPECT_GT(api_level, 0);
20
if
(api_level >= 29) {
21
EXPECT_EQ(
FlutterMain::SelectedRenderingAPI
(
settings
),
22
AndroidRenderingAPI::kImpellerVulkan
);
23
}
else
{
24
EXPECT_EQ(
FlutterMain::SelectedRenderingAPI
(
settings
),
25
AndroidRenderingAPI::kSkiaOpenGLES
);
26
}
27
}
28
29
TEST
(AndroidPlatformView, SoftwareRenderingNotSupportedWithImpeller) {
30
Settings
settings
;
31
settings
.enable_software_rendering =
true
;
32
settings
.enable_impeller =
true
;
33
34
ASSERT_DEATH(
FlutterMain::SelectedRenderingAPI
(
settings
),
""
);
35
}
36
37
}
// namespace testing
38
}
// namespace flutter
flutter::FlutterMain::SelectedRenderingAPI
static AndroidRenderingAPI SelectedRenderingAPI(const flutter::Settings &settings)
Definition:
flutter_main.cc:234
flutter_main.h
flutter::testing::TEST
TEST(DisplayListComplexity, EmptyDisplayList)
Definition:
dl_complexity_unittests.cc:47
flutter
Definition:
asset_manager.cc:10
flutter::AndroidRenderingAPI::kSkiaOpenGLES
@ kSkiaOpenGLES
flutter::AndroidRenderingAPI::kImpellerVulkan
@ kImpellerVulkan
gn.compile_sksl_tests.settings
settings
Definition:
compile_sksl_tests.py:18
flutter::Settings
Definition:
settings.h:104
Generated on Sun Jun 23 2024 21:55:10 for Flutter Engine by
1.9.4