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

Unified Diff: chrome/browser/history/history_browsertest.cc

Issue 10144015: Convert session history ui test to a browser test, renabling all the disabled tests and got rid of … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: readd history test (this isn't session history) Created 8 years, 8 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/session_history_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_browsertest.cc
===================================================================
--- chrome/browser/history/history_browsertest.cc (revision 133224)
+++ chrome/browser/history/history_browsertest.cc (working copy)
@@ -13,9 +13,11 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/url_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/web_contents.h"
#include "content/test/test_browser_thread.h"
#include "googleurl/src/gurl.h"
@@ -284,3 +286,19 @@
// Therefore, Page 21 should be in the history in addition to Page 22.
LoadAndWaitForFile("history_length_test_page_21.html");
}
+
+// If this test flakes, use bug 22111.
+IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, HistorySearchXSS) {
+ 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);
+ // Mainly, this is to ensure we send a synchronous message to the renderer
+ // so that we're not susceptible (less susceptible?) to a race condition.
+ // Should a race condition ever trigger, it won't result in flakiness.
+ int num = ui_test_utils::FindInPage(
+ browser()->GetSelectedTabContentsWrapper(), ASCIIToUTF16("<img"), true,
+ true, NULL);
+ EXPECT_GT(num, 0);
+ EXPECT_EQ(ASCIIToUTF16("History"),
+ browser()->GetSelectedWebContents()->GetTitle());
+}
« no previous file with comments | « no previous file | chrome/browser/session_history_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698