| 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 profile, new_browser, | 754 profile, new_browser, |
| 755 SessionRestore::CLOBBER_CURRENT_TAB | SessionRestore::SYNCHRONOUS, | 755 SessionRestore::CLOBBER_CURRENT_TAB | SessionRestore::SYNCHRONOUS, |
| 756 std::vector<GURL>()); | 756 std::vector<GURL>()); |
| 757 | 757 |
| 758 // The pinned tab is the selected tab. | 758 // The pinned tab is the selected tab. |
| 759 ASSERT_EQ(2, new_browser->tab_count()); | 759 ASSERT_EQ(2, new_browser->tab_count()); |
| 760 EXPECT_EQ(0, new_browser->active_index()); | 760 EXPECT_EQ(0, new_browser->active_index()); |
| 761 EXPECT_EQ(url1_, new_browser->GetActiveWebContents()->GetURL()); | 761 EXPECT_EQ(url1_, new_browser->GetActiveWebContents()->GetURL()); |
| 762 EXPECT_EQ(url2_, new_browser->GetWebContentsAt(1)->GetURL()); | 762 EXPECT_EQ(url2_, new_browser->GetWebContentsAt(1)->GetURL()); |
| 763 } | 763 } |
| 764 |
| 765 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, SessionStorage) { |
| 766 ui_test_utils::NavigateToURL(browser(), url1_); |
| 767 std::string session_storate_persistent_id = |
| 768 browser()->GetActiveWebContents()->GetController(). |
| 769 GetSessionStorageNamespace()->persistent_id(); |
| 770 LOG(WARNING) << session_storate_persistent_id; |
| 771 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); |
| 772 ASSERT_EQ(1u, BrowserList::size()); |
| 773 ASSERT_EQ(url1_, new_browser->GetActiveWebContents()->GetURL()); |
| 774 std::string restored_session_storate_persistent_id = |
| 775 browser()->GetActiveWebContents()->GetController(). |
| 776 GetSessionStorageNamespace()->persistent_id(); |
| 777 EXPECT_EQ(session_storate_persistent_id, |
| 778 restored_session_storate_persistent_id); |
| 779 } |
| OLD | NEW |