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

Unified Diff: chrome/browser/sessions/session_restore_browsertest.cc

Issue 12210048: Prevent bindings escalation on an existing NavigationEntry (attempt 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change URL in test. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore_browsertest.cc
diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc
index db1b87a737557c0863d0e971ff23605faaabf2fd..4a1c7731ca0fd23474e54f6a1f7646df537c724e 100644
--- a/chrome/browser/sessions/session_restore_browsertest.cc
+++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -35,7 +35,9 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/bindings_policy.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/test/test_navigation_observer.h"
#include "sync/protocol/session_specifics.pb.h"
@@ -583,6 +585,23 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, Basic) {
new_browser->tab_strip_model()->GetActiveWebContents()->GetURL());
}
+IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreWebUI) {
+ const GURL webui_url("chrome://newtab");
+ ui_test_utils::NavigateToURL(browser(), webui_url);
+ const content::WebContents* old_tab =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_EQ(content::BINDINGS_POLICY_WEB_UI,
+ old_tab->GetRenderViewHost()->GetEnabledBindings());
+
+ Browser* new_browser = QuitBrowserAndRestore(browser(), 1);
+ ASSERT_EQ(1u, native_browser_list->size());
+ const content::WebContents* new_tab =
+ new_browser->tab_strip_model()->GetActiveWebContents();
+ EXPECT_EQ(webui_url, new_tab->GetURL());
+ EXPECT_EQ(content::BINDINGS_POLICY_WEB_UI,
+ new_tab->GetRenderViewHost()->GetEnabledBindings());
+}
+
IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoresForwardAndBackwardNavs) {
ui_test_utils::NavigateToURL(browser(), url1_);
ui_test_utils::NavigateToURL(browser(), url2_);
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698