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

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: include logging.h Created 6 years, 2 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 TestingProfile profile; 204 TestingProfile profile;
206 notification_manager()->Add(GetANotification("test"), &profile); 205 notification_manager()->Add(GetANotification("test"), &profile);
207 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER); 206 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER);
208 run_loop()->RunUntilIdle(); 207 run_loop()->RunUntilIdle();
209 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); 208 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive());
210 EXPECT_FALSE(DidFirstRunPref()); 209 EXPECT_FALSE(DidFirstRunPref());
211 } 210 }
212 211
213 #endif 212 #endif
214 } // namespace message_center 213 } // namespace message_center
OLDNEW
« no previous file with comments | « chrome/browser/notifications/message_center_notifications_browsertest.cc ('k') | chrome/browser/notifications/notification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698