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/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 #if !defined(OS_CHROMEOS) && !defined(OS_MACOSX) | 432 #if !defined(OS_CHROMEOS) && !defined(OS_MACOSX) |
433 // Try alt-f4 to close the browser. | 433 // Try alt-f4 to close the browser. |
434 ASSERT_TRUE(SendKeyAndWait( | 434 ASSERT_TRUE(SendKeyAndWait( |
435 browser(), ui::VKEY_F4, ui::EF_ALT_DOWN, | 435 browser(), ui::VKEY_F4, ui::EF_ALT_DOWN, |
436 chrome::NOTIFICATION_BROWSER_CLOSED, | 436 chrome::NOTIFICATION_BROWSER_CLOSED, |
437 content::Source<Browser>(browser()))); | 437 content::Source<Browser>(browser()))); |
438 #endif | 438 #endif |
439 } | 439 } |
440 | 440 |
441 // Flakily fails and times out on Win only. http://crbug.com/69941 | |
442 // Fails on Linux. http://crbug.com/408634 | 441 // Fails on Linux. http://crbug.com/408634 |
443 #if defined(OS_WIN) || defined(OS_LINUX) | 442 #if defined(OS_LINUX) |
444 #define MAYBE_PopupAccelerators DISABLED_PopupAccelerators | 443 #define MAYBE_PopupAccelerators DISABLED_PopupAccelerators |
445 #else | 444 #else |
446 #define MAYBE_PopupAccelerators PopupAccelerators | 445 #define MAYBE_PopupAccelerators PopupAccelerators |
447 #endif | 446 #endif |
448 | 447 |
449 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_PopupAccelerators) { | 448 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_PopupAccelerators) { |
450 // Create a popup. | 449 // Create a popup. |
451 Browser* popup = CreateBrowserForPopup(browser()->profile()); | 450 Browser* popup = CreateBrowserForPopup(browser()->profile()); |
452 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(popup)); | 451 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(popup)); |
453 OmniboxView* omnibox_view = NULL; | 452 OmniboxView* omnibox_view = NULL; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 } | 792 } |
794 | 793 |
795 EXPECT_NE(old_text, omnibox_view->GetText()); | 794 EXPECT_NE(old_text, omnibox_view->GetText()); |
796 | 795 |
797 // Escape shall revert back to the default match item. | 796 // Escape shall revert back to the default match item. |
798 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); | 797 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); |
799 EXPECT_EQ(old_text, omnibox_view->GetText()); | 798 EXPECT_EQ(old_text, omnibox_view->GetText()); |
800 EXPECT_EQ(old_selected_line, popup_model->selected_line()); | 799 EXPECT_EQ(old_selected_line, popup_model->selected_line()); |
801 } | 800 } |
802 | 801 |
803 // Flaky on Windows: http://crbug.com/146619 | 802 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, BasicTextOperations) { |
804 #if defined(OS_WIN) | |
805 #define MAYBE_BasicTextOperations DISABLED_BasicTextOperations | |
806 #else | |
807 #define MAYBE_BasicTextOperations BasicTextOperations | |
808 #endif | |
809 | |
810 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_BasicTextOperations) { | |
811 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); | 803 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); |
812 chrome::FocusLocationBar(browser()); | 804 chrome::FocusLocationBar(browser()); |
813 | 805 |
814 OmniboxView* omnibox_view = NULL; | 806 OmniboxView* omnibox_view = NULL; |
815 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view)); | 807 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view)); |
816 | 808 |
817 base::string16 old_text = omnibox_view->GetText(); | 809 base::string16 old_text = omnibox_view->GetText(); |
818 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), old_text); | 810 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), old_text); |
819 EXPECT_TRUE(omnibox_view->IsSelectAll()); | 811 EXPECT_TRUE(omnibox_view->IsSelectAll()); |
820 | 812 |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 omnibox_view->Update(); | 1869 omnibox_view->Update(); |
1878 EXPECT_EQ(url_c, omnibox_view->GetText()); | 1870 EXPECT_EQ(url_c, omnibox_view->GetText()); |
1879 } | 1871 } |
1880 | 1872 |
1881 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, EscDisablesSearchTermReplacement) { | 1873 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, EscDisablesSearchTermReplacement) { |
1882 browser()->toolbar_model()->set_url_replacement_enabled(true); | 1874 browser()->toolbar_model()->set_url_replacement_enabled(true); |
1883 chrome::FocusLocationBar(browser()); | 1875 chrome::FocusLocationBar(browser()); |
1884 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); | 1876 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); |
1885 EXPECT_FALSE(browser()->toolbar_model()->url_replacement_enabled()); | 1877 EXPECT_FALSE(browser()->toolbar_model()->url_replacement_enabled()); |
1886 } | 1878 } |
OLD | NEW |