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

Side by Side Diff: content/browser/web_contents/navigation_controller_impl_unittest.cc

Issue 10850010: Make session restore understand that tabs have multiple SessionStorageNamespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, with test robustified. 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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 const SessionStorageNamespaceMap& other_session_storage_namespace_map = 2224 const SessionStorageNamespaceMap& other_session_storage_namespace_map =
2225 other_controller.GetSessionStorageNamespaceMap(); 2225 other_controller.GetSessionStorageNamespaceMap();
2226 EXPECT_EQ(session_storage_namespace_map.size(), 2226 EXPECT_EQ(session_storage_namespace_map.size(),
2227 other_session_storage_namespace_map.size()); 2227 other_session_storage_namespace_map.size());
2228 for (SessionStorageNamespaceMap::const_iterator it = 2228 for (SessionStorageNamespaceMap::const_iterator it =
2229 session_storage_namespace_map.begin(); 2229 session_storage_namespace_map.begin();
2230 it != session_storage_namespace_map.end(); 2230 it != session_storage_namespace_map.end();
2231 ++it) { 2231 ++it) {
2232 SessionStorageNamespaceMap::const_iterator other = 2232 SessionStorageNamespaceMap::const_iterator other =
2233 other_session_storage_namespace_map.find(it->first); 2233 other_session_storage_namespace_map.find(it->first);
2234 EXPECT_TRUE(other !=other_session_storage_namespace_map.end()); 2234 EXPECT_TRUE(other != other_session_storage_namespace_map.end());
2235 } 2235 }
2236 } 2236 }
2237 2237
2238 // Tests CopyStateFromAndPrune with 2 urls in source, 1 in dest. 2238 // Tests CopyStateFromAndPrune with 2 urls in source, 1 in dest.
2239 TEST_F(NavigationControllerTest, CopyStateFromAndPrune) { 2239 TEST_F(NavigationControllerTest, CopyStateFromAndPrune) {
2240 NavigationControllerImpl& controller = controller_impl(); 2240 NavigationControllerImpl& controller = controller_impl();
2241 const GURL url1("http://foo/1"); 2241 const GURL url1("http://foo/1");
2242 const GURL url2("http://foo/2"); 2242 const GURL url2("http://foo/2");
2243 const GURL url3("http://foo/3"); 2243 const GURL url3("http://foo/3");
2244 2244
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2750 TabNavigation nav(0, url0, GURL(), string16(), 2750 TabNavigation nav(0, url0, GURL(), string16(),
2751 webkit_glue::CreateHistoryStateForURL(url0), 2751 webkit_glue::CreateHistoryStateForURL(url0),
2752 content::PAGE_TRANSITION_LINK); 2752 content::PAGE_TRANSITION_LINK);
2753 session_helper_.AssertNavigationEquals(nav, 2753 session_helper_.AssertNavigationEquals(nav,
2754 windows_[0]->tabs[0]->navigations[0]); 2754 windows_[0]->tabs[0]->navigations[0]);
2755 nav.set_url(url2); 2755 nav.set_url(url2);
2756 session_helper_.AssertNavigationEquals(nav, 2756 session_helper_.AssertNavigationEquals(nav,
2757 windows_[0]->tabs[0]->navigations[1]); 2757 windows_[0]->tabs[0]->navigations[1]);
2758 } 2758 }
2759 */ 2759 */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698