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

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

Issue 12313067: Prevent bindings escalation on an existing NavigationEntry (attempt 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 f934e99d98dd067e5d49edb6ea2254e91ee3ce20..8dd5c17f8a8e4174297b43594276855f269831af 100644
--- a/chrome/browser/sessions/session_restore_browsertest.cc
+++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -36,7 +36,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"
@@ -584,6 +586,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