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

Side by Side Diff: chrome/browser/sessions/session_restore_browsertest.cc

Issue 20743002: Do not CreateSentinel until after the process singleton has been grabbed by the current process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge latest version of https://codereview.chromium.org/20483002/ Created 7 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/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/process/launch.h" 7 #include "base/process/launch.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 SessionServiceFactory::GetForProfile(browser()->profile())); 83 SessionServiceFactory::GetForProfile(browser()->profile()));
84 helper.SetForceBrowserNotAliveWithNoWindows(true); 84 helper.SetForceBrowserNotAliveWithNoWindows(true);
85 helper.ReleaseService(); 85 helper.ReleaseService();
86 } 86 }
87 #endif 87 #endif
88 88
89 InProcessBrowserTest::SetUpOnMainThread(); 89 InProcessBrowserTest::SetUpOnMainThread();
90 } 90 }
91 91
92 virtual bool SetUpUserDataDirectory() OVERRIDE { 92 virtual bool SetUpUserDataDirectory() OVERRIDE {
93 // Make sure the first run sentinel file exists before running these tests,
94 // since some of them customize the session startup pref whose value can
95 // be different than the default during the first run.
96 // TODO(bauerb): set the first run flag instead of creating a sentinel file.
97 first_run::CreateSentinel();
98
99 url1_ = ui_test_utils::GetTestUrl( 93 url1_ = ui_test_utils::GetTestUrl(
100 base::FilePath().AppendASCII("session_history"), 94 base::FilePath().AppendASCII("session_history"),
101 base::FilePath().AppendASCII("bot1.html")); 95 base::FilePath().AppendASCII("bot1.html"));
102 url2_ = ui_test_utils::GetTestUrl( 96 url2_ = ui_test_utils::GetTestUrl(
103 base::FilePath().AppendASCII("session_history"), 97 base::FilePath().AppendASCII("session_history"),
104 base::FilePath().AppendASCII("bot2.html")); 98 base::FilePath().AppendASCII("bot2.html"));
105 url3_ = ui_test_utils::GetTestUrl( 99 url3_ = ui_test_utils::GetTestUrl(
106 base::FilePath().AppendASCII("session_history"), 100 base::FilePath().AppendASCII("session_history"),
107 base::FilePath().AppendASCII("bot3.html")); 101 base::FilePath().AppendASCII("bot3.html"));
108 102
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 content::NavigationController* controller = 1123 content::NavigationController* controller =
1130 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); 1124 &browser()->tab_strip_model()->GetActiveWebContents()->GetController();
1131 EXPECT_TRUE( 1125 EXPECT_TRUE(
1132 controller->GetDefaultSessionStorageNamespace()->should_persist()); 1126 controller->GetDefaultSessionStorageNamespace()->should_persist());
1133 1127
1134 // Quit and restore. Check that no extra tabs were created. 1128 // Quit and restore. Check that no extra tabs were created.
1135 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); 1129 Browser* new_browser = QuitBrowserAndRestore(browser(), 1);
1136 ASSERT_EQ(1u, active_browser_list_->size()); 1130 ASSERT_EQ(1u, active_browser_list_->size());
1137 EXPECT_EQ(1, new_browser->tab_strip_model()->count()); 1131 EXPECT_EQ(1, new_browser->tab_strip_model()->count());
1138 } 1132 }
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run_unittest.cc ('k') | chrome/browser/ui/cocoa/first_run_dialog.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698