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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/extension_browsertest.h" 9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 int return_code; 666 int return_code;
667 StartupBrowserCreator browser_creator; 667 StartupBrowserCreator browser_creator;
668 std::vector<Profile*> last_opened_profiles; 668 std::vector<Profile*> last_opened_profiles;
669 last_opened_profiles.push_back(profile1); 669 last_opened_profiles.push_back(profile1);
670 last_opened_profiles.push_back(profile2); 670 last_opened_profiles.push_back(profile2);
671 browser_creator.Start(dummy, profile_manager->user_data_dir(), profile1, 671 browser_creator.Start(dummy, profile_manager->user_data_dir(), profile1,
672 last_opened_profiles, &return_code); 672 last_opened_profiles, &return_code);
673 673
674 while (SessionRestore::IsRestoring(profile1) || 674 while (SessionRestore::IsRestoring(profile1) ||
675 SessionRestore::IsRestoring(profile2)) 675 SessionRestore::IsRestoring(profile2))
676 MessageLoop::current()->RunUntilIdle(); 676 base::MessageLoop::current()->RunUntilIdle();
677 677
678 // The startup URLs are ignored, and instead the last open sessions are 678 // The startup URLs are ignored, and instead the last open sessions are
679 // restored. 679 // restored.
680 EXPECT_TRUE(profile1->restored_last_session()); 680 EXPECT_TRUE(profile1->restored_last_session());
681 EXPECT_TRUE(profile2->restored_last_session()); 681 EXPECT_TRUE(profile2->restored_last_session());
682 682
683 Browser* new_browser = NULL; 683 Browser* new_browser = NULL;
684 ASSERT_EQ(1u, chrome::GetBrowserCount(profile1, 684 ASSERT_EQ(1u, chrome::GetBrowserCount(profile1,
685 browser()->host_desktop_type())); 685 browser()->host_desktop_type()));
686 new_browser = FindOneOtherBrowserForProfile(profile1, NULL); 686 new_browser = FindOneOtherBrowserForProfile(profile1, NULL);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 last_opened_profiles.push_back(profile_last); 759 last_opened_profiles.push_back(profile_last);
760 last_opened_profiles.push_back(profile_urls); 760 last_opened_profiles.push_back(profile_urls);
761 browser_creator.Start(dummy, profile_manager->user_data_dir(), profile_home1, 761 browser_creator.Start(dummy, profile_manager->user_data_dir(), profile_home1,
762 last_opened_profiles, &return_code); 762 last_opened_profiles, &return_code);
763 763
764 while (SessionRestore::IsRestoring(default_profile) || 764 while (SessionRestore::IsRestoring(default_profile) ||
765 SessionRestore::IsRestoring(profile_home1) || 765 SessionRestore::IsRestoring(profile_home1) ||
766 SessionRestore::IsRestoring(profile_home2) || 766 SessionRestore::IsRestoring(profile_home2) ||
767 SessionRestore::IsRestoring(profile_last) || 767 SessionRestore::IsRestoring(profile_last) ||
768 SessionRestore::IsRestoring(profile_urls)) 768 SessionRestore::IsRestoring(profile_urls))
769 MessageLoop::current()->RunUntilIdle(); 769 base::MessageLoop::current()->RunUntilIdle();
770 770
771 Browser* new_browser = NULL; 771 Browser* new_browser = NULL;
772 // The last open profile (the profile_home1 in this case) will always be 772 // The last open profile (the profile_home1 in this case) will always be
773 // launched, even if it will open just the home page. 773 // launched, even if it will open just the home page.
774 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_home1, original_desktop_type)); 774 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_home1, original_desktop_type));
775 new_browser = FindOneOtherBrowserForProfile(profile_home1, NULL); 775 new_browser = FindOneOtherBrowserForProfile(profile_home1, NULL);
776 ASSERT_TRUE(new_browser); 776 ASSERT_TRUE(new_browser);
777 TabStripModel* tab_strip = new_browser->tab_strip_model(); 777 TabStripModel* tab_strip = new_browser->tab_strip_model();
778 ASSERT_EQ(1, tab_strip->count()); 778 ASSERT_EQ(1, tab_strip->count());
779 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), 779 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL),
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 945
946 // Managed user should be in elevated state. 946 // Managed user should be in elevated state.
947 bool is_elevated = ManagedModeNavigationObserver::FromWebContents( 947 bool is_elevated = ManagedModeNavigationObserver::FromWebContents(
948 web_contents)->is_elevated(); 948 web_contents)->is_elevated();
949 EXPECT_TRUE(is_elevated); 949 EXPECT_TRUE(is_elevated);
950 } 950 }
951 951
952 #endif // ENABLE_MANAGED_USERS 952 #endif // ENABLE_MANAGED_USERS
953 953
954 #endif // !OS_CHROMEOS 954 #endif // !OS_CHROMEOS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698