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

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

Issue 2703213004: Migrate extension notifications to the new NotificationDisplayService (Closed)
Patch Set: Migrate extension notifications to the new NotificationDisplayService Created 3 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 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/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void SetUp() override { 91 void SetUp() override {
92 profile_manager_ = base::MakeUnique<TestingProfileManager>( 92 profile_manager_ = base::MakeUnique<TestingProfileManager>(
93 TestingBrowserProcess::GetGlobal()); 93 TestingBrowserProcess::GetGlobal());
94 ASSERT_TRUE(profile_manager_->SetUp()); 94 ASSERT_TRUE(profile_manager_->SetUp());
95 profile_ = profile_manager_->CreateTestingProfile("Miguel"); 95 profile_ = profile_manager_->CreateTestingProfile("Miguel");
96 std::unique_ptr<NotificationUIManager> ui_manager = 96 std::unique_ptr<NotificationUIManager> ui_manager =
97 base::MakeUnique<StubNotificationUIManager>(); 97 base::MakeUnique<StubNotificationUIManager>();
98 std::unique_ptr<NotificationPlatformBridge> notification_bridge = 98 std::unique_ptr<NotificationPlatformBridge> notification_bridge =
99 base::MakeUnique<StubNotificationPlatformBridge>(); 99 base::MakeUnique<StubNotificationPlatformBridge>();
100 100
101 // TODO(peter): These tests should use the NotificationDisplayService, which
102 // will allow the StubNotificationPlatformBridge to be removed.
101 TestingBrowserProcess::GetGlobal()->SetNotificationUIManager( 103 TestingBrowserProcess::GetGlobal()->SetNotificationUIManager(
102 std::move(ui_manager)); 104 std::move(ui_manager));
103 TestingBrowserProcess::GetGlobal()->SetNotificationPlatformBridge( 105 TestingBrowserProcess::GetGlobal()->SetNotificationPlatformBridge(
104 std::move(notification_bridge)); 106 std::move(notification_bridge));
105 } 107 }
106 108
107 void TearDown() override { 109 void TearDown() override {
108 profile_manager_.reset(); 110 profile_manager_.reset();
109 TestingBrowserProcess::DeleteInstance(); 111 TestingBrowserProcess::DeleteInstance();
110 } 112 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 profile(), 425 profile(),
424 GURL() /* service_worker_scope */, 426 GURL() /* service_worker_scope */,
425 GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"), 427 GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"),
426 notification_data, NotificationResources(), 428 notification_data, NotificationResources(),
427 new MockNotificationDelegate("hello")); 429 new MockNotificationDelegate("hello"));
428 EXPECT_EQ("NotificationTest", 430 EXPECT_EQ("NotificationTest",
429 base::UTF16ToUTF8(notification.context_message())); 431 base::UTF16ToUTF8(notification.context_message()));
430 } 432 }
431 433
432 #endif // BUILDFLAG(ENABLE_EXTENSIONS) 434 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_common.h ('k') | chrome/browser/notifications/stub_notification_display_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698