Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
darwin
macos
framework
Source
KeyCodeMapTest.mm
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
#import "
KeyCodeMap_Internal.h
"
6
7
#import "flutter/testing/testing.h"
8
#include "third_party/googletest/googletest/include/gtest/gtest.h"
9
10
namespace
flutter
{
11
12
bool
operator==
(
const
LayoutGoal
&
a
,
const
LayoutGoal
&
b
) {
13
return
a
.keyCode ==
b
.keyCode &&
a
.keyChar ==
b
.keyChar &&
a
.mandatory ==
b
.mandatory;
14
}
15
16
namespace
testing {
17
18
// Spot check some expected values so that we know that some classes of key
19
// aren't excluded.
20
TEST
(KeyMappingTest, HasExpectedValues) {
21
// Has Space
22
EXPECT_NE(std::find(
kLayoutGoals
.begin(),
kLayoutGoals
.end(),
LayoutGoal
{0x31, 0x20, false}),
23
kLayoutGoals
.end());
24
// Has Digit0
25
EXPECT_NE(std::find(
kLayoutGoals
.begin(),
kLayoutGoals
.end(),
LayoutGoal
{0x1d, 0x30, true}),
26
kLayoutGoals
.end());
27
// Has KeyA
28
EXPECT_NE(std::find(
kLayoutGoals
.begin(),
kLayoutGoals
.end(),
LayoutGoal
{0x00, 0x61, true}),
29
kLayoutGoals
.end());
30
// Has Equal
31
EXPECT_NE(std::find(
kLayoutGoals
.begin(),
kLayoutGoals
.end(),
LayoutGoal
{0x18, 0x3d, false}),
32
kLayoutGoals
.end());
33
// Has IntlBackslash
34
EXPECT_NE(
35
std::find(
kLayoutGoals
.begin(),
kLayoutGoals
.end(),
LayoutGoal
{0x0a, 0x200000020, false}),
36
kLayoutGoals
.end());
37
}
38
}
// namespace testing
39
}
// namespace flutter
TEST
#define TEST(S, s, D, expected)
Definition
FitsInTest.cpp:15
b
static bool b
Definition
ffi_native_test_module.c:74
a
struct MyStruct a[10]
KeyCodeMap_Internal.h
flutter
Definition
asset_manager.cc:10
flutter::kLayoutGoals
const std::vector< LayoutGoal > kLayoutGoals
Definition
KeyCodeMap.g.mm:248
flutter::operator==
bool operator==(const ViewportMetrics &a, const ViewportMetrics &b)
Definition
viewport_metrics.cc:68
flutter::LayoutGoal
Definition
KeyCodeMap_Internal.h:94
Generated on Fri Apr 26 2024 06:14:26 for Flutter Engine by
1.9.8