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

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

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac win compile fixes Created 8 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/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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 ASSERT_EQ(2, new_browser->tab_count()); 766 ASSERT_EQ(2, new_browser->tab_count());
767 EXPECT_EQ(0, new_browser->active_index()); 767 EXPECT_EQ(0, new_browser->active_index());
768 EXPECT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); 768 EXPECT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL());
769 EXPECT_EQ(url2_, chrome::GetWebContentsAt(new_browser, 1)->GetURL()); 769 EXPECT_EQ(url2_, chrome::GetWebContentsAt(new_browser, 1)->GetURL());
770 } 770 }
771 771
772 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, SessionStorage) { 772 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, SessionStorage) {
773 ui_test_utils::NavigateToURL(browser(), url1_); 773 ui_test_utils::NavigateToURL(browser(), url1_);
774 const content::NavigationController& controller = 774 const content::NavigationController& controller =
775 chrome::GetActiveWebContents(browser())->GetController(); 775 chrome::GetActiveWebContents(browser())->GetController();
776 ASSERT_TRUE(controller.GetSessionStorageNamespace()); 776 ASSERT_TRUE(controller.GetSessionStorageNamespaceMap().find("")->second);
777 std::string session_storage_persistent_id = 777 std::string session_storage_persistent_id =
778 controller.GetSessionStorageNamespace()->persistent_id(); 778 controller.GetSessionStorageNamespaceMap().find("")
779 ->second->persistent_id();
779 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); 780 Browser* new_browser = QuitBrowserAndRestore(browser(), 1);
780 ASSERT_EQ(1u, BrowserList::size()); 781 ASSERT_EQ(1u, BrowserList::size());
781 ASSERT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL()); 782 ASSERT_EQ(url1_, chrome::GetActiveWebContents(new_browser)->GetURL());
782 const content::NavigationController& new_controller = 783 const content::NavigationController& new_controller =
783 chrome::GetActiveWebContents(new_browser)->GetController(); 784 chrome::GetActiveWebContents(new_browser)->GetController();
784 ASSERT_TRUE(new_controller.GetSessionStorageNamespace()); 785 ASSERT_TRUE(new_controller.GetSessionStorageNamespaceMap().find("")->second);
785 std::string restored_session_storage_persistent_id = 786 std::string restored_session_storage_persistent_id =
786 new_controller.GetSessionStorageNamespace()->persistent_id(); 787 new_controller.GetSessionStorageNamespaceMap().find("")
788 ->second->persistent_id();
787 EXPECT_EQ(session_storage_persistent_id, 789 EXPECT_EQ(session_storage_persistent_id,
788 restored_session_storage_persistent_id); 790 restored_session_storage_persistent_id);
789 } 791 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698