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

Side by Side Diff: chrome/browser/profiles/profile_window_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/profiles/profile_window.h" 5 #include "chrome/browser/profiles/profile_window.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // Notifies the main thread after all history backend thread tasks have run. 47 // Notifies the main thread after all history backend thread tasks have run.
48 class WaitForHistoryTask : public history::HistoryDBTask { 48 class WaitForHistoryTask : public history::HistoryDBTask {
49 public: 49 public:
50 WaitForHistoryTask() {} 50 WaitForHistoryTask() {}
51 51
52 bool RunOnDBThread(history::HistoryBackend* backend, 52 bool RunOnDBThread(history::HistoryBackend* backend,
53 history::HistoryDatabase* db) override { 53 history::HistoryDatabase* db) override {
54 return true; 54 return true;
55 } 55 }
56 56
57 void DoneRunOnMainThread() override { base::MessageLoop::current()->Quit(); } 57 void DoneRunOnMainThread() override {
58 base::MessageLoop::current()->QuitWhenIdle();
59 }
58 60
59 private: 61 private:
60 ~WaitForHistoryTask() override {} 62 ~WaitForHistoryTask() override {}
61 63
62 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); 64 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask);
63 }; 65 };
64 66
65 void WaitForHistoryBackendToRun(Profile* profile) { 67 void WaitForHistoryBackendToRun(Profile* profile) {
66 base::CancelableTaskTracker task_tracker; 68 base::CancelableTaskTracker task_tracker;
67 scoped_ptr<history::HistoryDBTask> task(new WaitForHistoryTask()); 69 scoped_ptr<history::HistoryDBTask> task(new WaitForHistoryTask());
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 WrenchMenuModel model_normal_profile(&accelerator_handler, browser()); 205 WrenchMenuModel model_normal_profile(&accelerator_handler, browser());
204 EXPECT_NE(-1, model_normal_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU)); 206 EXPECT_NE(-1, model_normal_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU));
205 207
206 // Guest browser has no bookmark menu. 208 // Guest browser has no bookmark menu.
207 Browser* guest_browser = OpenGuestBrowser(); 209 Browser* guest_browser = OpenGuestBrowser();
208 WrenchMenuModel model_guest_profile(&accelerator_handler, guest_browser); 210 WrenchMenuModel model_guest_profile(&accelerator_handler, guest_browser);
209 EXPECT_EQ(-1, model_guest_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU)); 211 EXPECT_EQ(-1, model_guest_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU));
210 } 212 }
211 213
212 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) 214 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698