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

Unified Diff: chrome/browser/sessions/better_session_restore_browsertest.cc

Issue 12208131: Better session restore: Remove a pointless test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/better_session_restore_browsertest.cc
diff --git a/chrome/browser/sessions/better_session_restore_browsertest.cc b/chrome/browser/sessions/better_session_restore_browsertest.cc
index 748db0f8eb1c2553761e151ca225824d94544355..fa11e34cad58f570b49fa710712f7f0173a506a4 100644
--- a/chrome/browser/sessions/better_session_restore_browsertest.cc
+++ b/chrome/browser/sessions/better_session_restore_browsertest.cc
@@ -525,80 +525,3 @@ IN_PROC_BROWSER_TEST_F(NoSessionRestoreTest, CookiesClearedOnExit) {
EXPECT_EQ(std::string(chrome::kAboutBlankURL), web_contents->GetURL().spec());
StoreDataWithPage("local_storage.html");
}
-
-class BetterSessionRestoreCrashTest : public BetterSessionRestoreTest {
- public:
- BetterSessionRestoreCrashTest() { }
-
- virtual void SetUpOnMainThread() OVERRIDE {
- BetterSessionRestoreTest::SetUpOnMainThread();
- SessionStartupPref::SetStartupPref(
- browser()->profile(), SessionStartupPref(SessionStartupPref::DEFAULT));
- }
-
- protected:
- void CrashTestWithPage(const std::string& filename) {
- Profile* profile = browser()->profile();
- Browser* browser_before_restore = browser();
- ASSERT_TRUE(browser_before_restore);
- StoreDataWithPage(browser_before_restore, filename);
-
- // Session restore data is written lazily but we cannot restore data that
- // was not saved. Be less lazy for the test.
- SessionServiceFactory::GetForProfile(profile)->Save();
-
- // Simulate a crash and a restart.
- browser_before_restore->window()->Close();
- SessionServiceFactory::GetForProfile(profile)->backend()->
- MoveCurrentSessionToLastSession();
- ProfileImpl* profile_impl = static_cast<ProfileImpl*>(profile);
- profile_impl->last_session_exit_type_ = Profile::EXIT_CRASHED;
-#if defined(OS_CHROMEOS)
- profile_impl->chromeos_enterprise_extension_observer_.reset(NULL);
-#endif
- StartupBrowserCreator::ClearLaunchedProfilesForTesting();
-
- CommandLine dummy(CommandLine::NO_PROGRAM);
- dummy.AppendSwitchASCII(switches::kTestType, "browser");
- int return_code;
- StartupBrowserCreator browser_creator;
- std::vector<Profile*> last_opened_profiles(1, profile);
- browser_creator.Start(dummy,
- g_browser_process->profile_manager()->user_data_dir(),
- profile, last_opened_profiles, &return_code);
-
- // The browser displays an info bar, use it to restore the session.
- Browser* browser_after_restore =
- FindOneOtherBrowserForProfile(profile, browser_before_restore);
- ASSERT_TRUE(browser_after_restore);
- content::WebContents* web_contents =
- browser_after_restore->tab_strip_model()->GetActiveWebContents();
- ASSERT_TRUE(web_contents);
- EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL());
- InfoBarService* infobar_service =
- InfoBarService::FromWebContents(web_contents);
- EXPECT_EQ(1U, infobar_service->GetInfoBarCount());
- infobar_service->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate()->
- Accept();
-
- // Session restore is done ascynhronously.
- base::RunLoop loop;
- loop.RunUntilIdle();
-
- // Check the restored page.
- web_contents =
- browser_after_restore->tab_strip_model()->GetWebContentsAt(0);
- ASSERT_TRUE(web_contents);
- EXPECT_EQ(GURL(fake_server_address() + test_path() + filename),
- web_contents->GetURL());
- CheckReloadedPageRestored(browser_after_restore);
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BetterSessionRestoreCrashTest);
-};
-
-// http://crbug.com/172770
-IN_PROC_BROWSER_TEST_F(BetterSessionRestoreCrashTest, DISABLED_SessionCookies) {
- CrashTestWithPage("session_cookies.html");
-}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698