Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc

Issue 848833002: 1. Adds null check when keymap is failed to load. 2. Moves xkb_rule_names construction into worker … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/events/event_constants.h" 6 #include "ui/events/event_constants.h"
7 #include "ui/events/keycodes/dom3/dom_code.h" 7 #include "ui/events/keycodes/dom3/dom_code.h"
8 #include "ui/events/keycodes/dom3/dom_key.h" 8 #include "ui/events/keycodes/dom3/dom_key.h"
9 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" 9 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
10 #include "ui/events/ozone/layout/layout_util.h" 10 #include "ui/events/ozone/layout/layout_util.h"
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 /* 46 */ {"tr", "tr", ""}, 800 /* 46 */ {"tr", "tr", ""},
801 /* 47 */ {"ua", "ua", ""}, 801 /* 47 */ {"ua", "ua", ""},
802 /* 48 */ {"by", "by", ""}, 802 /* 48 */ {"by", "by", ""},
803 /* 49 */ {"am", "am", ""}, 803 /* 49 */ {"am", "am", ""},
804 /* 50 */ {"ge", "ge", ""}, 804 /* 50 */ {"ge", "ge", ""},
805 /* 51 */ {"mn", "mn", ""}, 805 /* 51 */ {"mn", "mn", ""},
806 /* 52 */ {"ie", "ie", ""}}; 806 /* 52 */ {"ie", "ie", ""}};
807 for (size_t i = 0; i < arraysize(kVkeyTestCase); ++i) { 807 for (size_t i = 0; i < arraysize(kVkeyTestCase); ++i) {
808 SCOPED_TRACE(i); 808 SCOPED_TRACE(i);
809 const VkTestXkbKeyboardLayoutEngine::RuleNames* e = &kVkeyTestCase[i]; 809 const VkTestXkbKeyboardLayoutEngine::RuleNames* e = &kVkeyTestCase[i];
810 scoped_ptr<xkb_rule_names> names = 810 std::string layout_id;
811 layout_engine_->GetXkbRuleNames(e->layout_name); 811 std::string layout_variant;
812 EXPECT_EQ(names.get()->layout, e->layout); 812 XkbKeyboardLayoutEngine::ParseLayoutName(e->layout_name, &layout_id,
813 EXPECT_EQ(names.get()->variant, e->variant); 813 &layout_variant);
814 EXPECT_EQ(layout_id, e->layout);
815 EXPECT_EQ(layout_variant, e->variant);
814 } 816 }
815 } 817 }
816 818
817 } // namespace ui 819 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698