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

Side by Side Diff: chrome/browser/ui/browser_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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 void TearDownOnMainThread() override { 1036 void TearDownOnMainThread() override {
1037 // Cycle both the MessageLoop and the Cocoa runloop twice to flush out any 1037 // Cycle both the MessageLoop and the Cocoa runloop twice to flush out any
1038 // Chrome work that generates Cocoa work. Do this twice since there are two 1038 // Chrome work that generates Cocoa work. Do this twice since there are two
1039 // Browsers that must be closed. 1039 // Browsers that must be closed.
1040 CycleRunLoops(); 1040 CycleRunLoops();
1041 CycleRunLoops(); 1041 CycleRunLoops();
1042 1042
1043 // Run the application event loop to completion, which will cycle the 1043 // Run the application event loop to completion, which will cycle the
1044 // native MessagePump on all platforms. 1044 // native MessagePump on all platforms.
1045 base::MessageLoop::current()->task_runner()->PostTask( 1045 base::MessageLoop::current()->task_runner()->PostTask(
1046 FROM_HERE, base::MessageLoop::QuitClosure()); 1046 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
1047 base::MessageLoop::current()->Run(); 1047 base::MessageLoop::current()->Run();
1048 1048
1049 // Take care of any remaining Cocoa work. 1049 // Take care of any remaining Cocoa work.
1050 CycleRunLoops(); 1050 CycleRunLoops();
1051 1051
1052 // At this point, quit should be for real now. 1052 // At this point, quit should be for real now.
1053 ASSERT_EQ(0u, chrome::GetTotalBrowserCount()); 1053 ASSERT_EQ(0u, chrome::GetTotalBrowserCount());
1054 } 1054 }
1055 1055
1056 // A helper function that cycles the MessageLoop, and on Mac, the Cocoa run 1056 // A helper function that cycles the MessageLoop, and on Mac, the Cocoa run
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after
3185 3185
3186 // Sync navigation just to make sure IPC has passed (updated 3186 // Sync navigation just to make sure IPC has passed (updated
3187 // display mode is delivered to RP). 3187 // display mode is delivered to RP).
3188 content::TestNavigationObserver observer(app_contents, 1); 3188 content::TestNavigationObserver observer(app_contents, 1);
3189 ui_test_utils::NavigateToURL(app_browser, GURL(url::kAboutBlankURL)); 3189 ui_test_utils::NavigateToURL(app_browser, GURL(url::kAboutBlankURL));
3190 observer.Wait(); 3190 observer.Wait();
3191 3191
3192 CheckDisplayModeMQ(ASCIIToUTF16("fullscreen"), app_contents); 3192 CheckDisplayModeMQ(ASCIIToUTF16("fullscreen"), app_contents);
3193 } 3193 }
3194 3194
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc ('k') | chrome/browser/ui/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698