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

Side by Side Diff: ui/views/controls/table/table_view_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
« no previous file with comments | « ui/views/controls/table/table_view.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 (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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 return result; 232 return result;
233 } 233 }
234 234
235 void PressKey(ui::KeyboardCode code) { 235 void PressKey(ui::KeyboardCode code) {
236 ui::KeyEvent event(ui::ET_KEY_PRESSED, code, ui::EF_NONE); 236 ui::KeyEvent event(ui::ET_KEY_PRESSED, code, ui::EF_NONE);
237 table_->OnKeyPressed(event); 237 table_->OnKeyPressed(event);
238 } 238 }
239 239
240 protected: 240 protected:
241 scoped_ptr<TestTableModel2> model_; 241 std::unique_ptr<TestTableModel2> model_;
242 242
243 // Owned by |parent_|. 243 // Owned by |parent_|.
244 TableView* table_; 244 TableView* table_;
245 245
246 scoped_ptr<TableViewTestHelper> helper_; 246 std::unique_ptr<TableViewTestHelper> helper_;
247 247
248 private: 248 private:
249 scoped_ptr<View> parent_; 249 std::unique_ptr<View> parent_;
250 250
251 DISALLOW_COPY_AND_ASSIGN(TableViewTest); 251 DISALLOW_COPY_AND_ASSIGN(TableViewTest);
252 }; 252 };
253 253
254 // Verifies GetPaintRegion. 254 // Verifies GetPaintRegion.
255 TEST_F(TableViewTest, GetPaintRegion) { 255 TEST_F(TableViewTest, GetPaintRegion) {
256 // Two columns should be visible. 256 // Two columns should be visible.
257 EXPECT_EQ(2u, helper_->visible_col_count()); 257 EXPECT_EQ(2u, helper_->visible_col_count());
258 258
259 EXPECT_EQ("rows=0 4 cols=0 2", helper_->GetPaintRegion(table_->bounds())); 259 EXPECT_EQ("rows=0 4 cols=0 2", helper_->GetPaintRegion(table_->bounds()));
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 new_selection.AddIndexToSelection(0); 914 new_selection.AddIndexToSelection(0);
915 new_selection.AddIndexToSelection(1); 915 new_selection.AddIndexToSelection(1);
916 new_selection.set_active(0); 916 new_selection.set_active(0);
917 new_selection.set_anchor(0); 917 new_selection.set_anchor(0);
918 helper_->SetSelectionModel(new_selection); 918 helper_->SetSelectionModel(new_selection);
919 model_->RemoveRow(0); 919 model_->RemoveRow(0);
920 helper_->OnFocus(); 920 helper_->OnFocus();
921 } 921 }
922 922
923 } // namespace views 923 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/table/table_view.cc ('k') | ui/views/controls/textfield/textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698