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

Side by Side Diff: chrome/browser/ui/webui/sync_internals_ui_unittest.cc

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 "chrome/browser/ui/webui/sync_internals_ui.h" 5 #include "chrome/browser/ui/webui/sync_internals_ui.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <string> 8 #include <string>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 EXPECT_CALL(profile_sync_service_mock, GetJsController()) 70 EXPECT_CALL(profile_sync_service_mock, GetJsController())
71 .WillOnce(Return(mock_js_controller_.AsWeakPtr())); 71 .WillOnce(Return(mock_js_controller_.AsWeakPtr()));
72 72
73 EXPECT_CALL(mock_js_controller_, AddJsEventHandler(_)); 73 EXPECT_CALL(mock_js_controller_, AddJsEventHandler(_));
74 74
75 { 75 {
76 // Needed by |sync_internals_ui_|'s constructor. The 76 // Needed by |sync_internals_ui_|'s constructor. The
77 // message loop is provided by ChromeRenderViewHostTestHarness. 77 // message loop is provided by ChromeRenderViewHostTestHarness.
78 content::TestBrowserThread ui_thread_(BrowserThread::UI, 78 content::TestBrowserThread ui_thread_(BrowserThread::UI,
79 MessageLoopForUI::current()); 79 base::MessageLoopForUI::current());
80 // |sync_internals_ui_|'s constructor triggers all the 80 // |sync_internals_ui_|'s constructor triggers all the
81 // expectations above. 81 // expectations above.
82 web_ui_.reset(new TestSyncWebUI(web_contents())); 82 web_ui_.reset(new TestSyncWebUI(web_contents()));
83 sync_internals_ui_ = new SyncInternalsUI(web_ui_.get()); 83 sync_internals_ui_ = new SyncInternalsUI(web_ui_.get());
84 web_ui_->SetController(sync_internals_ui_); 84 web_ui_->SetController(sync_internals_ui_);
85 } 85 }
86 86
87 Mock::VerifyAndClearExpectations(profile_mock); 87 Mock::VerifyAndClearExpectations(profile_mock);
88 Mock::VerifyAndClearExpectations(&mock_js_controller_); 88 Mock::VerifyAndClearExpectations(&mock_js_controller_);
89 } 89 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 EXPECT_CALL(*profile_mock, GetProfileSyncService()) 149 EXPECT_CALL(*profile_mock, GetProfileSyncService())
150 .WillOnce(Return(static_cast<ProfileSyncService*>(NULL))); 150 .WillOnce(Return(static_cast<ProfileSyncService*>(NULL)));
151 browser_context_.reset(profile_mock); 151 browser_context_.reset(profile_mock);
152 152
153 ChromeRenderViewHostTestHarness::SetUp(); 153 ChromeRenderViewHostTestHarness::SetUp();
154 154
155 { 155 {
156 // Needed by |sync_internals_ui_|'s constructor. The 156 // Needed by |sync_internals_ui_|'s constructor. The
157 // message loop is provided by ChromeRenderViewHostTestHarness. 157 // message loop is provided by ChromeRenderViewHostTestHarness.
158 content::TestBrowserThread ui_thread_(BrowserThread::UI, 158 content::TestBrowserThread ui_thread_(BrowserThread::UI,
159 MessageLoopForUI::current()); 159 base::MessageLoopForUI::current());
160 // |sync_internals_ui_|'s constructor triggers all the 160 // |sync_internals_ui_|'s constructor triggers all the
161 // expectations above. 161 // expectations above.
162 web_ui_.reset(new TestSyncWebUI(web_contents())); 162 web_ui_.reset(new TestSyncWebUI(web_contents()));
163 sync_internals_ui_ = new SyncInternalsUI(web_ui_.get()); 163 sync_internals_ui_ = new SyncInternalsUI(web_ui_.get());
164 web_ui_->SetController(sync_internals_ui_); 164 web_ui_->SetController(sync_internals_ui_);
165 } 165 }
166 166
167 Mock::VerifyAndClearExpectations(profile_mock); 167 Mock::VerifyAndClearExpectations(profile_mock);
168 } 168 }
169 169
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall))); 210 ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall)));
211 211
212 ListValue args; 212 ListValue args;
213 sync_internals_ui_->OverrideHandleWebUIMessage( 213 sync_internals_ui_->OverrideHandleWebUIMessage(
214 GURL(), "getAboutInfo", args); 214 GURL(), "getAboutInfo", args);
215 } 215 }
216 216
217 } // namespace 217 } // namespace
218 218
219 */ 219 */
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/android/partner_bookmarks_shim_unittest.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698