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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc

Issue 1560293002: Rename KEY_ constants to avoid conflict with <linux/input.h> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments (Wez) Created 4 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 | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | components/exo/keyboard_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 content::TestBrowserThreadBundle thread_bundle_; 114 content::TestBrowserThreadBundle thread_bundle_;
115 TestingProfile profile_; 115 TestingProfile profile_;
116 CommandUpdater command_updater_; 116 CommandUpdater command_updater_;
117 TestingOmniboxEditController omnibox_edit_controller_; 117 TestingOmniboxEditController omnibox_edit_controller_;
118 scoped_ptr<TestingOmniboxViewViews> omnibox_view_; 118 scoped_ptr<TestingOmniboxViewViews> omnibox_view_;
119 }; 119 };
120 120
121 // Checks that a single change of the text in the omnibox invokes 121 // Checks that a single change of the text in the omnibox invokes
122 // only one call to OmniboxViewViews::UpdatePopup(). 122 // only one call to OmniboxViewViews::UpdatePopup().
123 TEST_F(OmniboxViewViewsTest, UpdatePopupCall) { 123 TEST_F(OmniboxViewViewsTest, UpdatePopupCall) {
124 ui::KeyEvent char_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::DomCode::KEY_A, 0, 124 ui::KeyEvent char_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::DomCode::US_A, 0,
125 ui::DomKey::FromCharacter('a'), 125 ui::DomKey::FromCharacter('a'),
126 ui::EventTimeForNow()); 126 ui::EventTimeForNow());
127 omnibox_textfield()->InsertChar(char_event); 127 omnibox_textfield()->InsertChar(char_event);
128 omnibox_view()->CheckUpdatePopupCallInfo( 128 omnibox_view()->CheckUpdatePopupCallInfo(
129 1, base::ASCIIToUTF16("a"), gfx::Range(1)); 129 1, base::ASCIIToUTF16("a"), gfx::Range(1));
130 130
131 char_event = 131 char_event =
132 ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_B, ui::DomCode::KEY_B, 0, 132 ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_B, ui::DomCode::US_B, 0,
133 ui::DomKey::FromCharacter('b'), ui::EventTimeForNow()); 133 ui::DomKey::FromCharacter('b'), ui::EventTimeForNow());
134 omnibox_textfield()->InsertChar(char_event); 134 omnibox_textfield()->InsertChar(char_event);
135 omnibox_view()->CheckUpdatePopupCallInfo( 135 omnibox_view()->CheckUpdatePopupCallInfo(
136 2, base::ASCIIToUTF16("ab"), gfx::Range(2)); 136 2, base::ASCIIToUTF16("ab"), gfx::Range(2));
137 137
138 ui::KeyEvent pressed(ui::ET_KEY_PRESSED, ui::VKEY_BACK, 0); 138 ui::KeyEvent pressed(ui::ET_KEY_PRESSED, ui::VKEY_BACK, 0);
139 omnibox_textfield()->OnKeyPressed(pressed); 139 omnibox_textfield()->OnKeyPressed(pressed);
140 omnibox_view()->CheckUpdatePopupCallInfo( 140 omnibox_view()->CheckUpdatePopupCallInfo(
141 3, base::ASCIIToUTF16("a"), gfx::Range(1)); 141 3, base::ASCIIToUTF16("a"), gfx::Range(1));
142 } 142 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | components/exo/keyboard_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698