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

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

Issue 2355543003: Invalidate the page state when restoring WebUIs (Closed)
Patch Set: add test Created 4 years, 3 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 | chrome/browser/ui/webui/md_history_ui.h » ('j') | chrome/browser/ui/webui/md_history_ui.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/better_session_restore_browsertest.cc
diff --git a/chrome/browser/sessions/better_session_restore_browsertest.cc b/chrome/browser/sessions/better_session_restore_browsertest.cc
index 07a97238305435238b506669a9f3e159c4bc4cf2..3d6e7ff15ec1c0820f75ae6d3bf68d740780d0bb 100644
--- a/chrome/browser/sessions/better_session_restore_browsertest.cc
+++ b/chrome/browser/sessions/better_session_restore_browsertest.cc
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/browser_process.h"
@@ -34,6 +35,8 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/webui/md_history_ui.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -482,6 +485,28 @@ IN_PROC_BROWSER_TEST_F(ContinueWhereILeftOffTest, SessionCookiesBrowserClose) {
CheckReloadedPageRestored(new_browser);
}
+// Test that switching MD History on behaves correctly with session restore.
+IN_PROC_BROWSER_TEST_F(ContinueWhereILeftOffTest, MDHistoryUpgrade) {
+ MdHistoryUI::use_test_title = true;
+ {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(features::kMaterialDesignHistory);
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ content::TitleWatcher title_watcher(web_contents,
+ base::ASCIIToUTF16("History"));
+ ui_test_utils::NavigateToURL(browser(), GURL("chrome://history"));
+ base::string16 final_title = title_watcher.WaitAndGetTitle();
+ }
+ {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndEnableFeature(features::kMaterialDesignHistory);
+ Browser* new_browser = QuitBrowserAndRestore(browser(), false);
+ // The new history page should have loaded.
+ CheckTitle(new_browser, base::ASCIIToUTF16("MD History"));
+ }
+}
+
// Test that leaving a popup open will not prevent session restore.
IN_PROC_BROWSER_TEST_F(ContinueWhereILeftOffTest,
SessionCookiesBrowserCloseWithPopupOpen) {
« no previous file with comments | « no previous file | chrome/browser/ui/webui/md_history_ui.h » ('j') | chrome/browser/ui/webui/md_history_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698