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

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

Issue 20924002: Try to restore window.opener when opening blocked popups (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/process/launch.h" 7 #include "base/process/launch.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 content::NavigationController* controller = 1107 content::NavigationController* controller =
1108 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); 1108 &browser()->tab_strip_model()->GetActiveWebContents()->GetController();
1109 ASSERT_TRUE(controller->GetDefaultSessionStorageNamespace()); 1109 ASSERT_TRUE(controller->GetDefaultSessionStorageNamespace());
1110 1110
1111 content::SessionStorageNamespaceMap session_storage_namespace_map; 1111 content::SessionStorageNamespaceMap session_storage_namespace_map;
1112 session_storage_namespace_map[std::string()] = 1112 session_storage_namespace_map[std::string()] =
1113 controller->GetDefaultSessionStorageNamespace(); 1113 controller->GetDefaultSessionStorageNamespace();
1114 scoped_ptr<content::WebContents> web_contents( 1114 scoped_ptr<content::WebContents> web_contents(
1115 content::WebContents::CreateWithSessionStorage( 1115 content::WebContents::CreateWithSessionStorage(
1116 content::WebContents::CreateParams(browser()->profile()), 1116 content::WebContents::CreateParams(browser()->profile()),
1117 session_storage_namespace_map)); 1117 session_storage_namespace_map,
1118 NULL));
1118 1119
1119 TabStripModel* tab_strip_model = browser()->tab_strip_model(); 1120 TabStripModel* tab_strip_model = browser()->tab_strip_model();
1120 scoped_ptr<content::WebContents> old_web_contents( 1121 scoped_ptr<content::WebContents> old_web_contents(
1121 tab_strip_model->ReplaceWebContentsAt( 1122 tab_strip_model->ReplaceWebContentsAt(
1122 tab_strip_model->active_index(), web_contents.release())); 1123 tab_strip_model->active_index(), web_contents.release()));
1123 // Navigate with the new tab. 1124 // Navigate with the new tab.
1124 ui_test_utils::NavigateToURL(browser(), url2_); 1125 ui_test_utils::NavigateToURL(browser(), url2_);
1125 // old_web_contents goes out of scope. 1126 // old_web_contents goes out of scope.
1126 } 1127 }
1127 1128
1128 // Check that the sessionStorage data is going to be persisted. 1129 // Check that the sessionStorage data is going to be persisted.
1129 content::NavigationController* controller = 1130 content::NavigationController* controller =
1130 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); 1131 &browser()->tab_strip_model()->GetActiveWebContents()->GetController();
1131 EXPECT_TRUE( 1132 EXPECT_TRUE(
1132 controller->GetDefaultSessionStorageNamespace()->should_persist()); 1133 controller->GetDefaultSessionStorageNamespace()->should_persist());
1133 1134
1134 // Quit and restore. Check that no extra tabs were created. 1135 // Quit and restore. Check that no extra tabs were created.
1135 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); 1136 Browser* new_browser = QuitBrowserAndRestore(browser(), 1);
1136 ASSERT_EQ(1u, active_browser_list_->size()); 1137 ASSERT_EQ(1u, active_browser_list_->size());
1137 EXPECT_EQ(1, new_browser->tab_strip_model()->count()); 1138 EXPECT_EQ(1, new_browser->tab_strip_model()->count());
1138 } 1139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698