Index: chrome/browser/history/history_browsertest.cc |
diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc |
index d244750854e60aaa5d6e7e0aa15566f9cfa3a4c1..dbf58ae9fce5338f32db49ed19a9da474bb8f8c6 100644 |
--- a/chrome/browser/history/history_browsertest.cc |
+++ b/chrome/browser/history/history_browsertest.cc |
@@ -7,6 +7,7 @@ |
#include "base/bind.h" |
#include "base/command_line.h" |
+#include "base/feature_list.h" |
#include "base/files/file_path.h" |
#include "base/macros.h" |
#include "base/message_loop/message_loop.h" |
@@ -18,6 +19,7 @@ |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_commands.h" |
#include "chrome/browser/ui/tabs/tab_strip_model.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" |
@@ -293,6 +295,14 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, |
#define MAYBE_HistorySearchXSS HistorySearchXSS |
#endif |
IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, MAYBE_HistorySearchXSS) { |
+ // TODO(tsergeant): Enable this test on MD History once it is possible to pass |
+ // in a query via URL (crbug.com/619799). |
+ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
+ feature_list->InitializeFromCommandLine( |
+ std::string(), features::kMaterialDesignHistoryFeature.name); |
+ base::FeatureList::ClearInstanceForTesting(); |
+ base::FeatureList::SetInstance(std::move(feature_list)); |
Dan Beam
2016/06/14 21:24:27
can you make this a utility method?
tsergeant
2016/06/14 23:58:02
Do you mean something like MDHistoryUI::DisableFor
Dan Beam
2016/06/14 23:59:52
yes
tsergeant
2016/06/15 01:57:29
Done.
|
+ |
GURL url(std::string(chrome::kChromeUIHistoryURL) + |
"#q=%3Cimg%20src%3Dx%3Ax%20onerror%3D%22document.title%3D'XSS'%22%3E"); |
ui_test_utils::NavigateToURL(browser(), url); |