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

Side by Side Diff: chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_nsobject.h" 5 #include "base/memory/scoped_nsobject.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/notifications/balloon.h" 7 #include "chrome/browser/notifications/balloon.h"
8 #include "chrome/browser/notifications/balloon_collection.h" 8 #include "chrome/browser/notifications/balloon_collection.h"
9 #include "chrome/browser/notifications/notification.h" 9 #include "chrome/browser/notifications/notification.h"
10 #include "chrome/browser/notifications/notification_object_proxy.h" 10 #include "chrome/browser/notifications/notification_object_proxy.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 NOTREACHED(); 53 NOTREACHED();
54 return balloons_; 54 return balloons_;
55 } 55 }
56 private: 56 private:
57 Balloons balloons_; 57 Balloons balloons_;
58 }; 58 };
59 59
60 class BalloonControllerTest : public ChromeRenderViewHostTestHarness { 60 class BalloonControllerTest : public ChromeRenderViewHostTestHarness {
61 public: 61 public:
62 BalloonControllerTest() : 62 BalloonControllerTest() :
63 ui_thread_(BrowserThread::UI, MessageLoop::current()), 63 ui_thread_(BrowserThread::UI, base::MessageLoop::current()),
64 file_user_blocking_thread_( 64 file_user_blocking_thread_(
65 BrowserThread::FILE_USER_BLOCKING, MessageLoop::current()), 65 BrowserThread::FILE_USER_BLOCKING, base::MessageLoop::current()),
66 io_thread_(BrowserThread::IO, MessageLoop::current()) { 66 io_thread_(BrowserThread::IO, base::MessageLoop::current()) {
67 } 67 }
68 68
69 virtual void SetUp() { 69 virtual void SetUp() {
70 ChromeRenderViewHostTestHarness::SetUp(); 70 ChromeRenderViewHostTestHarness::SetUp();
71 CocoaTest::BootstrapCocoa(); 71 CocoaTest::BootstrapCocoa();
72 profile()->CreateRequestContext(); 72 profile()->CreateRequestContext();
73 Browser::CreateParams native_params(profile(), 73 Browser::CreateParams native_params(profile(),
74 chrome::HOST_DESKTOP_TYPE_NATIVE); 74 chrome::HOST_DESKTOP_TYPE_NATIVE);
75 browser_.reset( 75 browser_.reset(
76 chrome::CreateBrowserWithTestWindowForParams(&native_params)); 76 chrome::CreateBrowserWithTestWindowForParams(&native_params));
77 collection_.reset(new MockBalloonCollection()); 77 collection_.reset(new MockBalloonCollection());
78 } 78 }
79 79
80 virtual void TearDown() { 80 virtual void TearDown() {
81 collection_.reset(); 81 collection_.reset();
82 browser_.reset(); 82 browser_.reset();
83 MessageLoop::current()->RunUntilIdle(); 83 base::MessageLoop::current()->RunUntilIdle();
84 ChromeRenderViewHostTestHarness::TearDown(); 84 ChromeRenderViewHostTestHarness::TearDown();
85 } 85 }
86 86
87 protected: 87 protected:
88 content::TestBrowserThread ui_thread_; 88 content::TestBrowserThread ui_thread_;
89 content::TestBrowserThread file_user_blocking_thread_; 89 content::TestBrowserThread file_user_blocking_thread_;
90 content::TestBrowserThread io_thread_; 90 content::TestBrowserThread io_thread_;
91 scoped_ptr<Browser> browser_; 91 scoped_ptr<Browser> browser_;
92 scoped_ptr<BalloonCollection> collection_; 92 scoped_ptr<BalloonCollection> collection_;
93 }; 93 };
(...skipping 28 matching lines...) Expand all
122 122
123 [controller showWindow:nil]; 123 [controller showWindow:nil];
124 124
125 EXPECT_TRUE([controller desiredTotalWidth] > 100); 125 EXPECT_TRUE([controller desiredTotalWidth] > 100);
126 EXPECT_TRUE([controller desiredTotalHeight] > 100); 126 EXPECT_TRUE([controller desiredTotalHeight] > 100);
127 127
128 [controller closeBalloon:YES]; 128 [controller closeBalloon:YES];
129 } 129 }
130 130
131 } 131 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/menu_controller_unittest.mm ('k') | chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698