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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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 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/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 PrefixSelectorTest() { 47 PrefixSelectorTest() {
48 selector_.reset(new PrefixSelector(&delegate_)); 48 selector_.reset(new PrefixSelector(&delegate_));
49 } 49 }
50 ~PrefixSelectorTest() override { 50 ~PrefixSelectorTest() override {
51 // Explicitly release |selector_| here which can happen before releasing 51 // Explicitly release |selector_| here which can happen before releasing
52 // |delegate_|. 52 // |delegate_|.
53 selector_.reset(); 53 selector_.reset();
54 } 54 }
55 55
56 protected: 56 protected:
57 scoped_ptr<PrefixSelector> selector_; 57 std::unique_ptr<PrefixSelector> selector_;
58 TestPrefixDelegate delegate_; 58 TestPrefixDelegate delegate_;
59 59
60 private: 60 private:
61 DISALLOW_COPY_AND_ASSIGN(PrefixSelectorTest); 61 DISALLOW_COPY_AND_ASSIGN(PrefixSelectorTest);
62 }; 62 };
63 63
64 TEST_F(PrefixSelectorTest, PrefixSelect) { 64 TEST_F(PrefixSelectorTest, PrefixSelect) {
65 selector_->InsertText(ASCIIToUTF16("an")); 65 selector_->InsertText(ASCIIToUTF16("an"));
66 EXPECT_EQ(1, delegate_.GetSelectedRow()); 66 EXPECT_EQ(1, delegate_.GetSelectedRow());
67 67
(...skipping 12 matching lines...) Expand all
80 EXPECT_EQ(2, delegate_.GetSelectedRow()); 80 EXPECT_EQ(2, delegate_.GetSelectedRow());
81 81
82 selector_->OnViewBlur(); 82 selector_->OnViewBlur();
83 selector_->InsertText(ASCIIToUTF16("\t")); 83 selector_->InsertText(ASCIIToUTF16("\t"));
84 selector_->InsertText(ASCIIToUTF16("b")); 84 selector_->InsertText(ASCIIToUTF16("b"));
85 selector_->InsertText(ASCIIToUTF16("a")); 85 selector_->InsertText(ASCIIToUTF16("a"));
86 EXPECT_EQ(2, delegate_.GetSelectedRow()); 86 EXPECT_EQ(2, delegate_.GetSelectedRow());
87 } 87 }
88 88
89 } // namespace views 89 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/native/native_view_host_unittest.cc ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698