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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/notifications/desktop_notification_service.h" 5 #include "chrome/browser/notifications/desktop_notification_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 12 matching lines...) Expand all
23 // on the IO thread. This class routes calls to the cache on the IO thread. 23 // on the IO thread. This class routes calls to the cache on the IO thread.
24 class ThreadProxy : public base::RefCountedThreadSafe<ThreadProxy> { 24 class ThreadProxy : public base::RefCountedThreadSafe<ThreadProxy> {
25 public: 25 public:
26 ThreadProxy() 26 ThreadProxy()
27 : io_event_(false, false), 27 : io_event_(false, false),
28 ui_event_(false, false), 28 ui_event_(false, false),
29 permission_(WebKit::WebNotificationPresenter::PermissionAllowed) { 29 permission_(WebKit::WebNotificationPresenter::PermissionAllowed) {
30 // The current message loop was already initalized by the test superclass. 30 // The current message loop was already initalized by the test superclass.
31 ui_thread_.reset( 31 ui_thread_.reset(
32 new content::TestBrowserThread(BrowserThread::UI, 32 new content::TestBrowserThread(BrowserThread::UI,
33 MessageLoop::current())); 33 base::MessageLoop::current()));
34 34
35 // Create IO thread, start its message loop. 35 // Create IO thread, start its message loop.
36 io_thread_.reset(new content::TestBrowserThread(BrowserThread::IO)); 36 io_thread_.reset(new content::TestBrowserThread(BrowserThread::IO));
37 io_thread_->Start(); 37 io_thread_->Start();
38 38
39 // Calling PauseIOThread() here isn't safe, because the runnable method 39 // Calling PauseIOThread() here isn't safe, because the runnable method
40 // could complete before the constructor is done, deleting |this|. 40 // could complete before the constructor is done, deleting |this|.
41 } 41 }
42 42
43 // Call the HasPermission method of the DesktopNotificationService on the IO 43 // Call the HasPermission method of the DesktopNotificationService on the IO
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( 187 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(
188 GURL("http://denied2.com")), 188 GURL("http://denied2.com")),
189 settings[3].primary_pattern); 189 settings[3].primary_pattern);
190 EXPECT_EQ(CONTENT_SETTING_BLOCK, 190 EXPECT_EQ(CONTENT_SETTING_BLOCK,
191 settings[3].setting); 191 settings[3].setting);
192 EXPECT_EQ(ContentSettingsPattern::Wildcard(), 192 EXPECT_EQ(ContentSettingsPattern::Wildcard(),
193 settings[4].primary_pattern); 193 settings[4].primary_pattern);
194 EXPECT_EQ(CONTENT_SETTING_ASK, 194 EXPECT_EQ(CONTENT_SETTING_ASK,
195 settings[4].setting); 195 settings[4].setting);
196 } 196 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/balloon_collection_impl.cc ('k') | chrome/browser/notifications/desktop_notifications_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698