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

Side by Side Diff: ui/views/controls/prefix_selector_unittest.cc

Issue 1177503003: Remove the 2-level input method system & InputMethodBridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits. Created 5 years, 5 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/views/controls/prefix_selector.cc ('k') | ui/views/controls/textfield/textfield.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/prefix_selector.h" 5 #include "ui/views/controls/prefix_selector.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 28 matching lines...) Expand all
39 int selected_row_; 39 int selected_row_;
40 40
41 DISALLOW_COPY_AND_ASSIGN(TestPrefixDelegate); 41 DISALLOW_COPY_AND_ASSIGN(TestPrefixDelegate);
42 }; 42 };
43 43
44 class PrefixSelectorTest : public ViewsTestBase { 44 class PrefixSelectorTest : public ViewsTestBase {
45 public: 45 public:
46 PrefixSelectorTest() { 46 PrefixSelectorTest() {
47 selector_.reset(new PrefixSelector(&delegate_)); 47 selector_.reset(new PrefixSelector(&delegate_));
48 } 48 }
49 ~PrefixSelectorTest() override {
50 // Explicitly release |selector_| here which can happen before releasing
51 // |delegate_|.
52 selector_.reset();
53 }
49 54
50 protected: 55 protected:
51 scoped_ptr<PrefixSelector> selector_; 56 scoped_ptr<PrefixSelector> selector_;
52 TestPrefixDelegate delegate_; 57 TestPrefixDelegate delegate_;
53 58
54 private: 59 private:
55 DISALLOW_COPY_AND_ASSIGN(PrefixSelectorTest); 60 DISALLOW_COPY_AND_ASSIGN(PrefixSelectorTest);
56 }; 61 };
57 62
58 TEST_F(PrefixSelectorTest, PrefixSelect) { 63 TEST_F(PrefixSelectorTest, PrefixSelect) {
(...skipping 15 matching lines...) Expand all
74 EXPECT_EQ(2, delegate_.GetSelectedRow()); 79 EXPECT_EQ(2, delegate_.GetSelectedRow());
75 80
76 selector_->OnViewBlur(); 81 selector_->OnViewBlur();
77 selector_->InsertText(ASCIIToUTF16("\t")); 82 selector_->InsertText(ASCIIToUTF16("\t"));
78 selector_->InsertText(ASCIIToUTF16("b")); 83 selector_->InsertText(ASCIIToUTF16("b"));
79 selector_->InsertText(ASCIIToUTF16("a")); 84 selector_->InsertText(ASCIIToUTF16("a"));
80 EXPECT_EQ(2, delegate_.GetSelectedRow()); 85 EXPECT_EQ(2, delegate_.GetSelectedRow());
81 } 86 }
82 87
83 } // namespace views 88 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/prefix_selector.cc ('k') | ui/views/controls/textfield/textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698