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

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

Issue 2703213004: Migrate extension notifications to the new NotificationDisplayService (Closed)
Patch Set: Finish functionality 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
Miguel Garcia 2017/02/21 10:56:44 I'd like to discuss this offline (and will not blo
Peter Beverloo 2017/02/21 17:23:50 Sure. In my mind, NotificationDisplayService will
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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 profile(), 438 profile(),
437 GURL() /* service_worker_scope */, 439 GURL() /* service_worker_scope */,
438 GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"), 440 GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"),
439 notification_data, NotificationResources(), 441 notification_data, NotificationResources(),
440 new MockNotificationDelegate("hello")); 442 new MockNotificationDelegate("hello"));
441 EXPECT_EQ("NotificationTest", 443 EXPECT_EQ("NotificationTest",
442 base::UTF16ToUTF8(notification.context_message())); 444 base::UTF16ToUTF8(notification.context_message()));
443 } 445 }
444 446
445 #endif // BUILDFLAG(ENABLE_EXTENSIONS) 447 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698