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

Side by Side Diff: chrome/browser/ui/browser_close_browsertest.cc

Issue 10825085: Move RunAllPendingInMessageLoop from ui_test_utils.h to test_utils.h, so that it can be reused by c… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/download/download_service.h" 10 #include "chrome/browser/download/download_service.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 check_case.profile_a.incognito.windows, 316 check_case.profile_a.incognito.windows,
317 check_case.profile_b.regular.windows, 317 check_case.profile_b.regular.windows,
318 check_case.profile_b.incognito.windows, 318 check_case.profile_b.incognito.windows,
319 }; 319 };
320 for (size_t j = 0; j < arraysize(browsers); ++j) { 320 for (size_t j = 0; j < arraysize(browsers); ++j) {
321 bool result = AdjustBrowsersOnProfile(browsers[j], window_counts[j]); 321 bool result = AdjustBrowsersOnProfile(browsers[j], window_counts[j]);
322 EXPECT_TRUE(result); 322 EXPECT_TRUE(result);
323 if (!result) 323 if (!result)
324 return false; 324 return false;
325 } 325 }
326 ui_test_utils::RunAllPendingInMessageLoop(); 326 content::RunAllPendingInMessageLoop();
327 327
328 // All that work, for this one little test. 328 // All that work, for this one little test.
329 EXPECT_TRUE((check_case.window_to_probe == 329 EXPECT_TRUE((check_case.window_to_probe ==
330 DownloadsCloseCheckCase::REGULAR) || 330 DownloadsCloseCheckCase::REGULAR) ||
331 (check_case.window_to_probe == 331 (check_case.window_to_probe ==
332 DownloadsCloseCheckCase::INCOGNITO)); 332 DownloadsCloseCheckCase::INCOGNITO));
333 if (!((check_case.window_to_probe == 333 if (!((check_case.window_to_probe ==
334 DownloadsCloseCheckCase::REGULAR) || 334 DownloadsCloseCheckCase::REGULAR) ||
335 (check_case.window_to_probe == 335 (check_case.window_to_probe ==
336 DownloadsCloseCheckCase::INCOGNITO))) 336 DownloadsCloseCheckCase::INCOGNITO)))
(...skipping 21 matching lines...) Expand all
358 entry_browser = CreateBrowserOnProfile(first_profile_); 358 entry_browser = CreateBrowserOnProfile(first_profile_);
359 for (BrowserList::const_iterator bit = BrowserList::begin(); 359 for (BrowserList::const_iterator bit = BrowserList::begin();
360 bit != BrowserList::end(); ++bit) { 360 bit != BrowserList::end(); ++bit) {
361 if ((*bit) != entry_browser) { 361 if ((*bit) != entry_browser) {
362 EXPECT_TRUE((*bit)->window()); 362 EXPECT_TRUE((*bit)->window());
363 if (!(*bit)->window()) 363 if (!(*bit)->window())
364 return false; 364 return false;
365 (*bit)->window()->Close(); 365 (*bit)->window()->Close();
366 } 366 }
367 } 367 }
368 ui_test_utils::RunAllPendingInMessageLoop(); 368 content::RunAllPendingInMessageLoop();
369 369
370 return true; 370 return true;
371 } 371 }
372 372
373 static const DownloadsCloseCheckCase download_close_check_cases[]; 373 static const DownloadsCloseCheckCase download_close_check_cases[];
374 374
375 // DownloadCloseCheck variables. 375 // DownloadCloseCheck variables.
376 Profile* first_profile_; 376 Profile* first_profile_;
377 Profile* second_profile_; 377 Profile* second_profile_;
378 378
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 574 }
575 } 575 }
576 576
577 IN_PROC_BROWSER_TEST_F(BrowserCloseTest, MAYBE_DownloadsCloseCheck_5) { 577 IN_PROC_BROWSER_TEST_F(BrowserCloseTest, MAYBE_DownloadsCloseCheck_5) {
578 ASSERT_TRUE(SetupForDownloadCloseCheck()); 578 ASSERT_TRUE(SetupForDownloadCloseCheck());
579 for (size_t i = 5 * arraysize(download_close_check_cases) / 6; 579 for (size_t i = 5 * arraysize(download_close_check_cases) / 6;
580 i < 6 * arraysize(download_close_check_cases) / 6; ++i) { 580 i < 6 * arraysize(download_close_check_cases) / 6; ++i) {
581 ExecuteDownloadCloseCheckCase(i); 581 ExecuteDownloadCloseCheckCase(i);
582 } 582 }
583 } 583 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | chrome/browser/ui/find_bar/find_bar_host_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698