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

Side by Side Diff: chrome/browser/history/history_browsertest.cc

Issue 2318643003: MD History: truncate title to 300 chars in C++ instead of JS (Closed)
Patch Set: more !android 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <utility> 5 #include <utility>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 // http://crbug.com/22111 (linux), http://crbug.com/530246 (win) 290 // http://crbug.com/22111 (linux), http://crbug.com/530246 (win)
291 #if defined(OS_LINUX) || defined(OS_WIN) 291 #if defined(OS_LINUX) || defined(OS_WIN)
292 #define MAYBE_HistorySearchXSS DISABLED_HistorySearchXSS 292 #define MAYBE_HistorySearchXSS DISABLED_HistorySearchXSS
293 #else 293 #else
294 #define MAYBE_HistorySearchXSS HistorySearchXSS 294 #define MAYBE_HistorySearchXSS HistorySearchXSS
295 #endif 295 #endif
296 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, MAYBE_HistorySearchXSS) { 296 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, MAYBE_HistorySearchXSS) {
297 // TODO(tsergeant): Enable this test on MD History once it is possible to pass 297 // TODO(tsergeant): Enable this test on MD History once it is possible to pass
298 // in a query via URL (crbug.com/619799). 298 // in a query via URL (crbug.com/619799).
299 MdHistoryUI::DisableForTesting(); 299 MdHistoryUI::SetEnabledForTesting(false);
300 300
301 GURL url(std::string(chrome::kChromeUIHistoryURL) + 301 GURL url(std::string(chrome::kChromeUIHistoryURL) +
302 "#q=%3Cimg%20src%3Dx%3Ax%20onerror%3D%22document.title%3D'XSS'%22%3E"); 302 "#q=%3Cimg%20src%3Dx%3Ax%20onerror%3D%22document.title%3D'XSS'%22%3E");
303 ui_test_utils::NavigateToURL(browser(), url); 303 ui_test_utils::NavigateToURL(browser(), url);
304 // Mainly, this is to ensure we send a synchronous message to the renderer 304 // Mainly, this is to ensure we send a synchronous message to the renderer
305 // so that we're not susceptible (less susceptible?) to a race condition. 305 // so that we're not susceptible (less susceptible?) to a race condition.
306 // Should a race condition ever trigger, it won't result in flakiness. 306 // Should a race condition ever trigger, it won't result in flakiness.
307 int num = ui_test_utils::FindInPage( 307 int num = ui_test_utils::FindInPage(
308 browser()->tab_strip_model()->GetActiveWebContents(), 308 browser()->tab_strip_model()->GetActiveWebContents(),
309 base::ASCIIToUTF16("<img"), true, 309 base::ASCIIToUTF16("<img"), true,
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 541
542 content::WebContents* active_web_contents = 542 content::WebContents* active_web_contents =
543 browser()->tab_strip_model()->GetActiveWebContents(); 543 browser()->tab_strip_model()->GetActiveWebContents();
544 ASSERT_EQ(web_contents, active_web_contents); 544 ASSERT_EQ(web_contents, active_web_contents);
545 ASSERT_EQ(history_url, active_web_contents->GetURL()); 545 ASSERT_EQ(history_url, active_web_contents->GetURL());
546 546
547 content::WebContents* second_tab = 547 content::WebContents* second_tab =
548 browser()->tab_strip_model()->GetWebContentsAt(1); 548 browser()->tab_strip_model()->GetWebContentsAt(1);
549 ASSERT_NE(history_url, second_tab->GetURL()); 549 ASSERT_NE(history_url, second_tab->GetURL());
550 } 550 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698