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

Side by Side Diff: ui/views/controls/table/table_view_unittest.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/table/table_view.h" 5 #include "ui/views/controls/table/table_view.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/views/controls/table/table_grouper.h" 10 #include "ui/views/controls/table/table_grouper.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 model.selected_indices()); 215 model.selected_indices());
216 for (size_t i = 0; i < selection.size(); ++i) { 216 for (size_t i = 0; i < selection.size(); ++i) {
217 if (i != 0) 217 if (i != 0)
218 result += " "; 218 result += " ";
219 result += base::IntToString(selection[i]); 219 result += base::IntToString(selection[i]);
220 } 220 }
221 return result; 221 return result;
222 } 222 }
223 223
224 void PressKey(ui::KeyboardCode code) { 224 void PressKey(ui::KeyboardCode code) {
225 ui::KeyEvent event(ui::ET_KEY_PRESSED, code, 0, false); 225 ui::KeyEvent event(ui::ET_KEY_PRESSED, code, ui::EF_NONE);
226 table_->OnKeyPressed(event); 226 table_->OnKeyPressed(event);
227 } 227 }
228 228
229 protected: 229 protected:
230 scoped_ptr<TestTableModel2> model_; 230 scoped_ptr<TestTableModel2> model_;
231 231
232 // Owned by |parent_|. 232 // Owned by |parent_|.
233 TableView* table_; 233 TableView* table_;
234 234
235 scoped_ptr<TableViewTestHelper> helper_; 235 scoped_ptr<TableViewTestHelper> helper_;
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 837
838 // Extend selection to first row. 838 // Extend selection to first row.
839 ClickOnRow(0, ui::EF_SHIFT_DOWN); 839 ClickOnRow(0, ui::EF_SHIFT_DOWN);
840 EXPECT_EQ(1, observer.GetChangedCountAndClear()); 840 EXPECT_EQ(1, observer.GetChangedCountAndClear());
841 EXPECT_EQ("active=2 anchor=4 selection=2 3 4", SelectionStateAsString()); 841 EXPECT_EQ("active=2 anchor=4 selection=2 3 4", SelectionStateAsString());
842 842
843 table_->SetObserver(NULL); 843 table_->SetObserver(NULL);
844 } 844 }
845 845
846 } // namespace views 846 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller_unittest.cc ('k') | ui/views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698