| Flutter macOS Embedder |

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
KeyCodeMap_Internal.h
flutter::testing::TEST
TEST(FlutterAppDelegateTest, DoesNotCallDelegatesWithoutHandler)
Definition: FlutterAppDelegateTest.mm:32
flutter
Definition: AccessibilityBridgeMac.h:16
flutter::operator==
bool operator==(const LayoutGoal &a, const LayoutGoal &b)
Definition: KeyCodeMapTest.mm:12
flutter::kLayoutGoals
const std::vector< LayoutGoal > kLayoutGoals
Definition: KeyCodeMap.g.mm:248
flutter::LayoutGoal
Definition: KeyCodeMap_Internal.h:94
flutter::LayoutGoal::keyChar
uint64_t keyChar
Definition: KeyCodeMap_Internal.h:99
flutter::LayoutGoal::mandatory
bool mandatory
Definition: KeyCodeMap_Internal.h:103
flutter::LayoutGoal::keyCode
uint16_t keyCode
Definition: KeyCodeMap_Internal.h:96