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

Side by Side Diff: components/omnibox/browser/omnibox_edit_unittest.cc

Issue 2423253002: Remove space from omnibox test. (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // alternate nav URL would fail a DCHECK if the input began with "http://". 371 // alternate nav URL would fail a DCHECK if the input began with "http://".
372 // The failure was due to erroneously trying to strip the scheme from the 372 // The failure was due to erroneously trying to strip the scheme from the
373 // resulting fill_into_edit. Alternate nav matches are never shown, so there's 373 // resulting fill_into_edit. Alternate nav matches are never shown, so there's
374 // no need to ever try and strip this scheme. 374 // no need to ever try and strip this scheme.
375 TEST_F(OmniboxEditTest, AlternateNavHasHTTP) { 375 TEST_F(OmniboxEditTest, AlternateNavHasHTTP) {
376 const TestingOmniboxClient* client = 376 const TestingOmniboxClient* client =
377 static_cast<TestingOmniboxClient*>(model()->client()); 377 static_cast<TestingOmniboxClient*>(model()->client());
378 const AutocompleteMatch match( 378 const AutocompleteMatch match(
379 model()->autocomplete_controller()->search_provider(), 0, false, 379 model()->autocomplete_controller()->search_provider(), 0, false,
380 AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED); 380 AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED);
381 const GURL alternate_nav_url("http://ab%20cd/"); 381 const GURL alternate_nav_url("http://abcd/");
382 382
383 model()->OnSetFocus(false); // Avoids DCHECK in OpenMatch(). 383 model()->OnSetFocus(false); // Avoids DCHECK in OpenMatch().
384 model()->SetUserText(base::ASCIIToUTF16("http://ab cd")); 384 model()->SetUserText(base::ASCIIToUTF16("http://abcd"));
385 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB, 385 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB,
386 alternate_nav_url, base::string16(), 0); 386 alternate_nav_url, base::string16(), 0);
387 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( 387 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme(
388 client->alternate_nav_match().fill_into_edit)); 388 client->alternate_nav_match().fill_into_edit));
389 389
390 model()->SetUserText(base::ASCIIToUTF16("ab cd")); 390 model()->SetUserText(base::ASCIIToUTF16("abcd"));
391 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB, 391 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB,
392 alternate_nav_url, base::string16(), 0); 392 alternate_nav_url, base::string16(), 0);
393 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( 393 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme(
394 client->alternate_nav_match().fill_into_edit)); 394 client->alternate_nav_match().fill_into_edit));
395 } 395 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698