Flutter Engine
The Flutter Engine
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
6
7#import "flutter/testing/testing.h"
8#include "third_party/googletest/googletest/include/gtest/gtest.h"
9
10namespace flutter {
11
12bool operator==(const LayoutGoal& a, const LayoutGoal& b) {
13 return a.keyCode == b.keyCode && a.keyChar == b.keyChar && a.mandatory == b.mandatory;
14}
15
16namespace testing {
17
18// Spot check some expected values so that we know that some classes of key
19// aren't excluded.
20TEST(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
int find(T *array, int N, T item)
static bool b
struct MyStruct a[10]
TEST(DisplayListComplexity, EmptyDisplayList)
const std::vector< LayoutGoal > kLayoutGoals
bool operator==(const ViewportMetrics &a, const ViewportMetrics &b)