Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
linux
key_mapping_test.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 "
key_mapping.h
"
6
#include <gmodule.h>
7
#include <algorithm>
8
#include <vector>
9
10
#include "gtest/gtest.h"
11
12
bool
operator==
(
const
LayoutGoal
&
a
,
const
LayoutGoal
&
b
) {
13
return
a
.keycode ==
b
.keycode &&
a
.logical_key ==
b
.logical_key &&
14
a
.mandatory ==
b
.mandatory;
15
}
16
17
// Spot check some expected values so that we know that some classes of key
18
// aren't excluded.
19
TEST
(KeyMappingTest, HasExpectedValues) {
20
// Has Space
21
EXPECT_NE(std::find(
layout_goals
.begin(),
layout_goals
.end(),
22
LayoutGoal
{0x41, 0x20, false}),
23
layout_goals
.end());
24
// Has Digit0
25
EXPECT_NE(std::find(
layout_goals
.begin(),
layout_goals
.end(),
26
LayoutGoal
{0x13, 0x30, true}),
27
layout_goals
.end());
28
// Has KeyA
29
EXPECT_NE(std::find(
layout_goals
.begin(),
layout_goals
.end(),
30
LayoutGoal
{0x26, 0x61, true}),
31
layout_goals
.end());
32
// Has Equal
33
EXPECT_NE(std::find(
layout_goals
.begin(),
layout_goals
.end(),
34
LayoutGoal
{0x15, 0x3d, false}),
35
layout_goals
.end());
36
// Has IntlBackslash
37
EXPECT_NE(std::find(
layout_goals
.begin(),
layout_goals
.end(),
38
LayoutGoal
{0x5e, 0x200000020, false}),
39
layout_goals
.end());
40
}
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]
layout_goals
const std::vector< LayoutGoal > layout_goals
Definition
key_mapping.g.cc:462
key_mapping.h
operator==
bool operator==(const LayoutGoal &a, const LayoutGoal &b)
Definition
key_mapping_test.cc:12
LayoutGoal
Definition
key_mapping.h:40
Generated on Fri Apr 26 2024 06:14:32 for Flutter Engine by
1.9.8