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 <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 // Backspace at the beginning of the search text shall turn off | 532 // Backspace at the beginning of the search text shall turn off |
533 // the keyword mode. | 533 // the keyword mode. |
534 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_BACK, 0)); | 534 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_BACK, 0)); |
535 ASSERT_FALSE(omnibox_view->model()->is_keyword_hint()); | 535 ASSERT_FALSE(omnibox_view->model()->is_keyword_hint()); |
536 ASSERT_EQ(base::string16(), omnibox_view->model()->keyword()); | 536 ASSERT_EQ(base::string16(), omnibox_view->model()->keyword()); |
537 ASSERT_EQ(std::string(kSearchKeyword) + kSearchText, | 537 ASSERT_EQ(std::string(kSearchKeyword) + kSearchText, |
538 UTF16ToUTF8(omnibox_view->GetText())); | 538 UTF16ToUTF8(omnibox_view->GetText())); |
539 } | 539 } |
540 | 540 |
541 // http://crbug.com/158913 | 541 // http://crbug.com/158913 |
542 #if defined(OS_CHROMEOS) || defined(OS_WIN) | 542 #if defined(USE_AURA) |
543 #define MAYBE_Escape DISABLED_Escape | 543 #define MAYBE_Escape DISABLED_Escape |
544 #else | 544 #else |
545 #define MAYBE_Escape Escape | 545 #define MAYBE_Escape Escape |
546 #endif | 546 #endif |
547 | 547 |
548 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_Escape) { | 548 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_Escape) { |
549 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); | 549 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); |
550 chrome::FocusLocationBar(browser()); | 550 chrome::FocusLocationBar(browser()); |
551 | 551 |
552 OmniboxView* omnibox_view = NULL; | 552 OmniboxView* omnibox_view = NULL; |
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 omnibox_view->Update(); | 1799 omnibox_view->Update(); |
1800 EXPECT_EQ(url_c, omnibox_view->GetText()); | 1800 EXPECT_EQ(url_c, omnibox_view->GetText()); |
1801 } | 1801 } |
1802 | 1802 |
1803 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, EscDisablesSearchTermReplacement) { | 1803 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, EscDisablesSearchTermReplacement) { |
1804 browser()->toolbar_model()->set_url_replacement_enabled(true); | 1804 browser()->toolbar_model()->set_url_replacement_enabled(true); |
1805 chrome::FocusLocationBar(browser()); | 1805 chrome::FocusLocationBar(browser()); |
1806 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); | 1806 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); |
1807 EXPECT_FALSE(browser()->toolbar_model()->url_replacement_enabled()); | 1807 EXPECT_FALSE(browser()->toolbar_model()->url_replacement_enabled()); |
1808 } | 1808 } |
OLD | NEW |