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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
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 #include <stdio.h> 6 #include <stdio.h>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/scoped_observer.h" 10 #include "base/scoped_observer.h"
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 685
686 // Create another tab in the foreground. 686 // Create another tab in the foreground.
687 AddTabAtIndex(1, url1, ui::PAGE_TRANSITION_TYPED); 687 AddTabAtIndex(1, url1, ui::PAGE_TRANSITION_TYPED);
688 EXPECT_EQ(2, browser()->tab_strip_model()->count()); 688 EXPECT_EQ(2, browser()->tab_strip_model()->count());
689 EXPECT_EQ(1, browser()->tab_strip_model()->active_index()); 689 EXPECT_EQ(1, browser()->tab_strip_model()->active_index());
690 690
691 // Navigate in the first tab, currently in the background. 691 // Navigate in the first tab, currently in the background.
692 GURL url2("data:text/html,page2"); 692 GURL url2("data:text/html,page2");
693 chrome::NavigateParams params(browser(), url2, ui::PAGE_TRANSITION_LINK); 693 chrome::NavigateParams params(browser(), url2, ui::PAGE_TRANSITION_LINK);
694 params.source_contents = contents; 694 params.source_contents = contents;
695 params.disposition = CURRENT_TAB; 695 params.disposition = WindowOpenDisposition::CURRENT_TAB;
696 ui_test_utils::NavigateToURL(&params); 696 ui_test_utils::NavigateToURL(&params);
697 697
698 // Switch back to the first tab. The user text should be cleared, and the 698 // Switch back to the first tab. The user text should be cleared, and the
699 // omnibox should have the new URL. 699 // omnibox should have the new URL.
700 browser()->tab_strip_model()->ActivateTabAt(0, true); 700 browser()->tab_strip_model()->ActivateTabAt(0, true);
701 EXPECT_EQ(ASCIIToUTF16(url2.spec()), omnibox_view->GetText()); 701 EXPECT_EQ(ASCIIToUTF16(url2.spec()), omnibox_view->GetText());
702 } 702 }
703 703
704 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, AltEnter) { 704 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, AltEnter) {
705 OmniboxView* omnibox_view = NULL; 705 OmniboxView* omnibox_view = NULL;
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 1988
1989 // Now Shift+Right should do nothing, and Shift+Left should reduce. 1989 // Now Shift+Right should do nothing, and Shift+Left should reduce.
1990 // At the end, so Shift+Right should do nothing. 1990 // At the end, so Shift+Right should do nothing.
1991 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_RIGHT, ui::EF_SHIFT_DOWN)); 1991 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_RIGHT, ui::EF_SHIFT_DOWN));
1992 EXPECT_EQ(2u, GetSelectionSize(omnibox_view)); 1992 EXPECT_EQ(2u, GetSelectionSize(omnibox_view));
1993 1993
1994 // And Left should reduce by one character. 1994 // And Left should reduce by one character.
1995 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_LEFT, ui::EF_SHIFT_DOWN)); 1995 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_LEFT, ui::EF_SHIFT_DOWN));
1996 EXPECT_EQ(1u, GetSelectionSize(omnibox_view)); 1996 EXPECT_EQ(1u, GetSelectionSize(omnibox_view));
1997 } 1997 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/login/login_handler_browsertest.cc ('k') | chrome/browser/ui/passwords/manage_passwords_ui_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698