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

Unified Diff: chrome/browser/notifications/platform_notification_service_unittest.cc

Issue 2381633002: Fix uninit read in PlatformNotificationServiceTest (Closed)
Patch Set: Fix uninit value, more cleanup. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/notifications/platform_notification_service_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/platform_notification_service_unittest.cc
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc
index ac36b8c103fca086448a534cf68923a1251bbe19..5f3956459606acb49824c41351eef9363a46dc18 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -77,6 +77,8 @@ class MockDesktopNotificationDelegate
private:
bool displayed_;
bool clicked_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockDesktopNotificationDelegate);
};
} // namespace
@@ -84,14 +86,14 @@ class MockDesktopNotificationDelegate
class PlatformNotificationServiceTest : public testing::Test {
public:
void SetUp() override {
- profile_manager_.reset(
- new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
+ profile_manager_ = base::MakeUnique<TestingProfileManager>(
+ TestingBrowserProcess::GetGlobal());
ASSERT_TRUE(profile_manager_->SetUp());
profile_ = profile_manager_->CreateTestingProfile("Miguel");
- std::unique_ptr<NotificationUIManager> ui_manager(
- new StubNotificationUIManager);
- std::unique_ptr<NotificationPlatformBridge> notification_bridge(
- new StubNotificationPlatformBridge());
+ std::unique_ptr<NotificationUIManager> ui_manager =
+ base::MakeUnique<StubNotificationUIManager>();
+ std::unique_ptr<NotificationPlatformBridge> notification_bridge =
+ base::MakeUnique<StubNotificationPlatformBridge>();
TestingBrowserProcess::GetGlobal()->SetNotificationUIManager(
std::move(ui_manager));
@@ -254,7 +256,11 @@ TEST_F(PlatformNotificationServiceTest, DisplayPersistentNotificationMatches) {
notification_data.vibration_pattern = vibration_pattern;
notification_data.silent = true;
notification_data.actions.resize(2);
+ notification_data.actions[0].type =
awdf 2016/09/29 10:47:57 Am I correct in surmising that it was just the lac
awdf 2016/09/29 13:06:34 Peter's since explained that the test which gave t
+ content::PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON;
notification_data.actions[0].title = base::ASCIIToUTF16("Button 1");
+ notification_data.actions[1].type =
+ content::PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON;
notification_data.actions[1].title = base::ASCIIToUTF16("Button 2");
NotificationResources notification_resources;
« no previous file with comments | « chrome/browser/notifications/platform_notification_service_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698