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

Side by Side Diff: chrome/browser/instant/instant_browsertest.cc

Issue 5787008: Makes instant not suggest string that look like urls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge and convert active to displayable Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/instant/instant_controller.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" 8 #include "chrome/browser/autocomplete/autocomplete_edit_view.h"
9 #include "chrome/browser/browser_list.h" 9 #include "chrome/browser/browser_list.h"
10 #include "chrome/browser/browser_window.h" 10 #include "chrome/browser/browser_window.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 // Check that the value is reflected and oncancel is called. 461 // Check that the value is reflected and oncancel is called.
462 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( 462 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript(
463 true, "window.chrome.sv", contents)); 463 true, "window.chrome.sv", contents));
464 EXPECT_NO_FATAL_FAILURE(CheckStringValueFromJavascript( 464 EXPECT_NO_FATAL_FAILURE(CheckStringValueFromJavascript(
465 "abc", "window.chrome.searchBox.value", contents)); 465 "abc", "window.chrome.searchBox.value", contents));
466 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( 466 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript(
467 false, "window.chrome.searchBox.verbatim", contents)); 467 false, "window.chrome.searchBox.verbatim", contents));
468 EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript( 468 EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript(
469 1, "window.oncancelcalls", contents)); 469 1, "window.oncancelcalls", contents));
470 } 470 }
471
472 // Verify that suggestion that looks like a url ('www.google.com' in this case)
473 // is not shown.
474 IN_PROC_BROWSER_TEST_F(InstantTest, DontShowURLSuggest) {
475 ASSERT_TRUE(test_server()->Start());
476 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("suggest_google.html"));
477 ASSERT_NO_FATAL_FAILURE(FindLocationBar());
478 location_bar_->location_entry()->SetUserText(L"w");
479 InstantController* instant = browser()->instant();
480 ASSERT_TRUE(instant);
481 ASSERT_TRUE(instant->IsShowingInstant());
482 ASSERT_TRUE(instant->GetPreviewContents());
483 ui_test_utils::WaitForNavigation(
484 &(instant->GetPreviewContents()->controller()));
485 ASSERT_NO_FATAL_FAILURE(WaitForMessageToBeProcessedByRenderer(
486 instant->GetPreviewContents()));
487 // TODO: remove this second change when 66104 is fixed.
488 location_bar_->location_entry()->SetUserText(L"ww");
489 ASSERT_NO_FATAL_FAILURE(WaitForMessageToBeProcessedByRenderer(
490 instant->GetPreviewContents()));
491 ASSERT_TRUE(instant->is_displayable());
492
493 location_bar_->location_entry()->SetUserText(L"www");
494 ASSERT_NO_FATAL_FAILURE(WaitForMessageToBeProcessedByRenderer(
495 instant->GetPreviewContents()));
496 ASSERT_EQ(UTF16ToWide(string16()),
497 UTF16ToWide(instant->GetCompleteSuggestedText()));
498 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/instant/instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698