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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 | 767 |
768 // The pinned tab is the selected tab. | 768 // The pinned tab is the selected tab. |
769 ASSERT_EQ(2, new_browser->tab_count()); | 769 ASSERT_EQ(2, new_browser->tab_count()); |
770 EXPECT_EQ(0, new_browser->active_index()); | 770 EXPECT_EQ(0, new_browser->active_index()); |
771 EXPECT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); | 771 EXPECT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); |
772 EXPECT_EQ(url2_, chrome::GetWebContentsAt(new_browser, 1)->GetURL()); | 772 EXPECT_EQ(url2_, chrome::GetWebContentsAt(new_browser, 1)->GetURL()); |
773 } | 773 } |
774 | 774 |
775 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, SessionStorage) { | 775 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, SessionStorage) { |
776 ui_test_utils::NavigateToURL(browser(), url1_); | 776 ui_test_utils::NavigateToURL(browser(), url1_); |
777 const content::NavigationController& controller = | 777 content::NavigationController* controller = |
778 chrome::GetActiveWebContents(browser())->GetController(); | 778 &chrome::GetActiveWebContents(browser())->GetController(); |
779 ASSERT_TRUE(controller.GetSessionStorageNamespace()); | 779 ASSERT_TRUE(controller->GetDefaultSessionStorageNamespace()); |
780 std::string session_storage_persistent_id = | 780 std::string session_storage_persistent_id = |
781 controller.GetSessionStorageNamespace()->persistent_id(); | 781 controller->GetDefaultSessionStorageNamespace()->persistent_id(); |
782 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); | 782 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); |
783 ASSERT_EQ(1u, BrowserList::size()); | 783 ASSERT_EQ(1u, BrowserList::size()); |
784 ASSERT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); | 784 ASSERT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); |
785 const content::NavigationController& new_controller = | 785 content::NavigationController* new_controller = |
786 chrome::GetActiveWebContents(new_browser)->GetController(); | 786 &chrome::GetActiveWebContents(new_browser)->GetController(); |
787 ASSERT_TRUE(new_controller.GetSessionStorageNamespace()); | 787 ASSERT_TRUE(new_controller->GetDefaultSessionStorageNamespace()); |
788 std::string restored_session_storage_persistent_id = | 788 std::string restored_session_storage_persistent_id = |
789 new_controller.GetSessionStorageNamespace()->persistent_id(); | 789 new_controller->GetDefaultSessionStorageNamespace()->persistent_id(); |
790 EXPECT_EQ(session_storage_persistent_id, | 790 EXPECT_EQ(session_storage_persistent_id, |
791 restored_session_storage_persistent_id); | 791 restored_session_storage_persistent_id); |
792 } | 792 } |
OLD | NEW |