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

Side by Side Diff: ui/message_center/views/notifier_settings_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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.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/message_center/fake_notifier_settings_provider.h" 10 #include "ui/message_center/fake_notifier_settings_provider.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 size_t request_count() const { return request_count_; } 48 size_t request_count() const { return request_count_; }
49 const NotifierId* last_requested_notifier_id() const { 49 const NotifierId* last_requested_notifier_id() const {
50 return last_notifier_id_settings_requested_.get(); 50 return last_notifier_id_settings_requested_.get();
51 } 51 }
52 52
53 private: 53 private:
54 NotifierId settings_handler_id_; 54 NotifierId settings_handler_id_;
55 size_t request_count_; 55 size_t request_count_;
56 scoped_ptr<NotifierId> last_notifier_id_settings_requested_; 56 std::unique_ptr<NotifierId> last_notifier_id_settings_requested_;
57 }; 57 };
58 58
59 } // namespace 59 } // namespace
60 60
61 class NotifierSettingsViewTest : public testing::Test { 61 class NotifierSettingsViewTest : public testing::Test {
62 public: 62 public:
63 NotifierSettingsViewTest(); 63 NotifierSettingsViewTest();
64 ~NotifierSettingsViewTest() override; 64 ~NotifierSettingsViewTest() override;
65 65
66 void SetUp() override; 66 void SetUp() override;
67 void TearDown() override; 67 void TearDown() override;
68 68
69 NotifierSettingsView* GetView() const; 69 NotifierSettingsView* GetView() const;
70 TestingNotifierSettingsProvider* settings_provider() const { 70 TestingNotifierSettingsProvider* settings_provider() const {
71 return settings_provider_.get(); 71 return settings_provider_.get();
72 } 72 }
73 73
74 private: 74 private:
75 scoped_ptr<TestingNotifierSettingsProvider> settings_provider_; 75 std::unique_ptr<TestingNotifierSettingsProvider> settings_provider_;
76 scoped_ptr<NotifierSettingsView> notifier_settings_view_; 76 std::unique_ptr<NotifierSettingsView> notifier_settings_view_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(NotifierSettingsViewTest); 78 DISALLOW_COPY_AND_ASSIGN(NotifierSettingsViewTest);
79 }; 79 };
80 80
81 NotifierSettingsViewTest::NotifierSettingsViewTest() {} 81 NotifierSettingsViewTest::NotifierSettingsViewTest() {}
82 82
83 NotifierSettingsViewTest::~NotifierSettingsViewTest() {} 83 NotifierSettingsViewTest::~NotifierSettingsViewTest() {}
84 84
85 void NotifierSettingsViewTest::SetUp() { 85 void NotifierSettingsViewTest::SetUp() {
86 std::vector<Notifier*> notifiers; 86 std::vector<Notifier*> notifiers;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 EXPECT_EQ(1u, number_of_settings_buttons); 118 EXPECT_EQ(1u, number_of_settings_buttons);
119 EXPECT_EQ(1u, settings_provider()->request_count()); 119 EXPECT_EQ(1u, settings_provider()->request_count());
120 const NotifierId* last_settings_button_id = 120 const NotifierId* last_settings_button_id =
121 settings_provider()->last_requested_notifier_id(); 121 settings_provider()->last_requested_notifier_id();
122 ASSERT_FALSE(last_settings_button_id == NULL); 122 ASSERT_FALSE(last_settings_button_id == NULL);
123 EXPECT_EQ(NotifierId(NotifierId::APPLICATION, "id"), 123 EXPECT_EQ(NotifierId(NotifierId::APPLICATION, "id"),
124 *last_settings_button_id); 124 *last_settings_button_id);
125 } 125 }
126 126
127 } // namespace message_center 127 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/notifier_settings_view.cc ('k') | ui/message_center/views/toast_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698