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

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

Issue 554213003: Request the icon of a Web Notification in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/prefs/testing_pref_service.h" 6 #include "base/prefs/testing_pref_service.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 g_browser_process->notification_ui_manager(); 94 g_browser_process->notification_ui_manager();
95 } 95 }
96 96
97 FakeMessageCenterTrayDelegate* delegate() { return delegate_; } 97 FakeMessageCenterTrayDelegate* delegate() { return delegate_; }
98 98
99 MessageCenter* message_center() { return message_center_; } 99 MessageCenter* message_center() { return message_center_; }
100 100
101 const ::Notification GetANotification(const std::string& id) { 101 const ::Notification GetANotification(const std::string& id) {
102 return ::Notification( 102 return ::Notification(
103 GURL("chrome-extension://adflkjsdflkdsfdsflkjdsflkdjfs"), 103 GURL("chrome-extension://adflkjsdflkdsfdsflkjdsflkdjfs"),
104 GURL(),
105 base::string16(), 104 base::string16(),
106 base::string16(), 105 base::string16(),
107 blink::WebTextDirectionDefault, 106 gfx::Image(),
108 base::string16(), 107 base::string16(),
109 base::UTF8ToUTF16(id), 108 base::UTF8ToUTF16(id),
110 new MockNotificationDelegate(id)); 109 new MockNotificationDelegate(id));
111 } 110 }
112 111
113 base::RunLoop* run_loop() { return run_loop_.get(); } 112 base::RunLoop* run_loop() { return run_loop_.get(); }
114 PrefService* local_state() { 113 PrefService* local_state() {
115 return TestingBrowserProcess::GetGlobal()->local_state(); 114 return TestingBrowserProcess::GetGlobal()->local_state();
116 } 115 }
117 bool DidFirstRunPref() { return first_run_pref_->GetValue(); } 116 bool DidFirstRunPref() { return first_run_pref_->GetValue(); }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 TestingProfile profile; 196 TestingProfile profile;
198 notification_manager()->Add(GetANotification("test"), &profile); 197 notification_manager()->Add(GetANotification("test"), &profile);
199 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER); 198 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER);
200 run_loop()->RunUntilIdle(); 199 run_loop()->RunUntilIdle();
201 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); 200 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive());
202 EXPECT_FALSE(DidFirstRunPref()); 201 EXPECT_FALSE(DidFirstRunPref());
203 } 202 }
204 203
205 #endif 204 #endif
206 } // namespace message_center 205 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698