| OLD | NEW |
| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 TEST_F(OmniboxEditTest, AlternateNavHasHTTP) { | 376 TEST_F(OmniboxEditTest, AlternateNavHasHTTP) { |
| 377 const TestingOmniboxClient* client = | 377 const TestingOmniboxClient* client = |
| 378 static_cast<TestingOmniboxClient*>(model()->client()); | 378 static_cast<TestingOmniboxClient*>(model()->client()); |
| 379 const AutocompleteMatch match( | 379 const AutocompleteMatch match( |
| 380 model()->autocomplete_controller()->search_provider(), 0, false, | 380 model()->autocomplete_controller()->search_provider(), 0, false, |
| 381 AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED); | 381 AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED); |
| 382 const GURL alternate_nav_url("http://ab%20cd/"); | 382 const GURL alternate_nav_url("http://ab%20cd/"); |
| 383 | 383 |
| 384 model()->OnSetFocus(false); // Avoids DCHECK in OpenMatch(). | 384 model()->OnSetFocus(false); // Avoids DCHECK in OpenMatch(). |
| 385 model()->SetUserText(base::ASCIIToUTF16("http://ab cd")); | 385 model()->SetUserText(base::ASCIIToUTF16("http://ab cd")); |
| 386 model()->OpenMatch(match, CURRENT_TAB, alternate_nav_url, base::string16(), | 386 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB, |
| 387 0); | 387 alternate_nav_url, base::string16(), 0); |
| 388 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( | 388 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( |
| 389 client->alternate_nav_match().fill_into_edit)); | 389 client->alternate_nav_match().fill_into_edit)); |
| 390 | 390 |
| 391 model()->SetUserText(base::ASCIIToUTF16("ab cd")); | 391 model()->SetUserText(base::ASCIIToUTF16("ab cd")); |
| 392 model()->OpenMatch(match, CURRENT_TAB, alternate_nav_url, base::string16(), | 392 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB, |
| 393 0); | 393 alternate_nav_url, base::string16(), 0); |
| 394 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( | 394 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( |
| 395 client->alternate_nav_match().fill_into_edit)); | 395 client->alternate_nav_match().fill_into_edit)); |
| 396 } | 396 } |
| OLD | NEW |