OLD | NEW |
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/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // (http://crbug.com/120927) | 169 // (http://crbug.com/120927) |
170 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, NoSessionRestoreNewWindowChromeOS) { | 170 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, NoSessionRestoreNewWindowChromeOS) { |
171 GURL url(ui_test_utils::GetTestUrl( | 171 GURL url(ui_test_utils::GetTestUrl( |
172 FilePath(FilePath::kCurrentDirectory), | 172 FilePath(FilePath::kCurrentDirectory), |
173 FilePath(FILE_PATH_LITERAL("title1.html")))); | 173 FilePath(FILE_PATH_LITERAL("title1.html")))); |
174 | 174 |
175 // Add a single tab. | 175 // Add a single tab. |
176 ui_test_utils::NavigateToURL(browser(), url); | 176 ui_test_utils::NavigateToURL(browser(), url); |
177 | 177 |
178 Browser* incognito_browser = CreateIncognitoBrowser(); | 178 Browser* incognito_browser = CreateIncognitoBrowser(); |
179 incognito_browser->AddBlankTab(true); | 179 chrome::AddBlankTab(incognito_browser, true); |
180 incognito_browser->window()->Show(); | 180 incognito_browser->window()->Show(); |
181 | 181 |
182 // Close the normal browser. After this we only have the incognito window | 182 // Close the normal browser. After this we only have the incognito window |
183 // open. | 183 // open. |
184 CloseBrowserSynchronously(browser()); | 184 CloseBrowserSynchronously(browser()); |
185 | 185 |
186 // Create a new window, which should open NTP. | 186 // Create a new window, which should open NTP. |
187 ui_test_utils::BrowserAddedObserver browser_added_observer; | 187 ui_test_utils::BrowserAddedObserver browser_added_observer; |
188 chrome::NewWindow(incognito_browser); | 188 chrome::NewWindow(incognito_browser); |
189 Browser* new_browser = browser_added_observer.WaitForSingleNewBrowser(); | 189 Browser* new_browser = browser_added_observer.WaitForSingleNewBrowser(); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, IncognitotoNonIncognito) { | 349 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, IncognitotoNonIncognito) { |
350 GURL url(ui_test_utils::GetTestUrl( | 350 GURL url(ui_test_utils::GetTestUrl( |
351 FilePath(FilePath::kCurrentDirectory), | 351 FilePath(FilePath::kCurrentDirectory), |
352 FilePath(FILE_PATH_LITERAL("title1.html")))); | 352 FilePath(FILE_PATH_LITERAL("title1.html")))); |
353 | 353 |
354 // Add a single tab. | 354 // Add a single tab. |
355 ui_test_utils::NavigateToURL(browser(), url); | 355 ui_test_utils::NavigateToURL(browser(), url); |
356 | 356 |
357 // Create a new incognito window. | 357 // Create a new incognito window. |
358 Browser* incognito_browser = CreateIncognitoBrowser(); | 358 Browser* incognito_browser = CreateIncognitoBrowser(); |
359 incognito_browser->AddBlankTab(true); | 359 chrome::AddBlankTab(incognito_browser, true); |
360 incognito_browser->window()->Show(); | 360 incognito_browser->window()->Show(); |
361 | 361 |
362 // Close the normal browser. After this we only have the incognito window | 362 // Close the normal browser. After this we only have the incognito window |
363 // open. | 363 // open. |
364 CloseBrowserSynchronously(browser()); | 364 CloseBrowserSynchronously(browser()); |
365 | 365 |
366 // Create a new window, which should trigger session restore. | 366 // Create a new window, which should trigger session restore. |
367 ui_test_utils::BrowserAddedObserver browser_added_observer; | 367 ui_test_utils::BrowserAddedObserver browser_added_observer; |
368 chrome::NewWindow(incognito_browser); | 368 chrome::NewWindow(incognito_browser); |
369 Browser* new_browser = browser_added_observer.WaitForSingleNewBrowser(); | 369 Browser* new_browser = browser_added_observer.WaitForSingleNewBrowser(); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 ASSERT_EQ(1u, BrowserList::size()); | 780 ASSERT_EQ(1u, BrowserList::size()); |
781 ASSERT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); | 781 ASSERT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); |
782 const content::NavigationController& new_controller = | 782 const content::NavigationController& new_controller = |
783 chrome::GetActiveWebContents(new_browser)->GetController(); | 783 chrome::GetActiveWebContents(new_browser)->GetController(); |
784 ASSERT_TRUE(new_controller.GetSessionStorageNamespace()); | 784 ASSERT_TRUE(new_controller.GetSessionStorageNamespace()); |
785 std::string restored_session_storage_persistent_id = | 785 std::string restored_session_storage_persistent_id = |
786 new_controller.GetSessionStorageNamespace()->persistent_id(); | 786 new_controller.GetSessionStorageNamespace()->persistent_id(); |
787 EXPECT_EQ(session_storage_persistent_id, | 787 EXPECT_EQ(session_storage_persistent_id, |
788 restored_session_storage_persistent_id); | 788 restored_session_storage_persistent_id); |
789 } | 789 } |
OLD | NEW |