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

Side by Side Diff: chrome/browser/notifications/platform_notification_service_unittest.cc

Issue 2703213004: Migrate extension notifications to the new NotificationDisplayService (Closed)
Patch Set: Miguel's comments Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void SetUp() override { 89 void SetUp() override {
90 profile_manager_ = base::MakeUnique<TestingProfileManager>( 90 profile_manager_ = base::MakeUnique<TestingProfileManager>(
91 TestingBrowserProcess::GetGlobal()); 91 TestingBrowserProcess::GetGlobal());
92 ASSERT_TRUE(profile_manager_->SetUp()); 92 ASSERT_TRUE(profile_manager_->SetUp());
93 profile_ = profile_manager_->CreateTestingProfile("Miguel"); 93 profile_ = profile_manager_->CreateTestingProfile("Miguel");
94 std::unique_ptr<NotificationUIManager> ui_manager = 94 std::unique_ptr<NotificationUIManager> ui_manager =
95 base::MakeUnique<StubNotificationUIManager>(); 95 base::MakeUnique<StubNotificationUIManager>();
96 std::unique_ptr<NotificationPlatformBridge> notification_bridge = 96 std::unique_ptr<NotificationPlatformBridge> notification_bridge =
97 base::MakeUnique<StubNotificationPlatformBridge>(); 97 base::MakeUnique<StubNotificationPlatformBridge>();
98 98
99 // TODO(peter): These tests should use the NotificationDisplayService, which
100 // will allow the StubNotificationPlatformBridge to be removed.
99 TestingBrowserProcess::GetGlobal()->SetNotificationUIManager( 101 TestingBrowserProcess::GetGlobal()->SetNotificationUIManager(
100 std::move(ui_manager)); 102 std::move(ui_manager));
101 TestingBrowserProcess::GetGlobal()->SetNotificationPlatformBridge( 103 TestingBrowserProcess::GetGlobal()->SetNotificationPlatformBridge(
102 std::move(notification_bridge)); 104 std::move(notification_bridge));
103 } 105 }
104 106
105 void TearDown() override { 107 void TearDown() override {
106 profile_manager_.reset(); 108 profile_manager_.reset();
107 TestingBrowserProcess::DeleteInstance(); 109 TestingBrowserProcess::DeleteInstance();
108 } 110 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 profile(), 412 profile(),
411 GURL() /* service_worker_scope */, 413 GURL() /* service_worker_scope */,
412 GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"), 414 GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"),
413 notification_data, NotificationResources(), 415 notification_data, NotificationResources(),
414 new MockNotificationDelegate("hello")); 416 new MockNotificationDelegate("hello"));
415 EXPECT_EQ("NotificationTest", 417 EXPECT_EQ("NotificationTest",
416 base::UTF16ToUTF8(notification.context_message())); 418 base::UTF16ToUTF8(notification.context_message()));
417 } 419 }
418 420
419 #endif // BUILDFLAG(ENABLE_EXTENSIONS) 421 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698