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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm

Issue 2232863002: Remove search::GetSearchTerms since it always returns empty string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_query_extract
Patch Set: Android Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm
index dba4ce000ee97c4b5e7086e09b369e3bc048f398..3f1a19a7a5ac49960ea0bcf25181d006f52913a7 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm
@@ -219,12 +219,6 @@ TEST_F(AutocompleteTextFieldEditorObserverTest, Copy) {
[editor_ copy:nil];
}
-// Test that -showURL: is correctly delegated to the observer.
-TEST_F(AutocompleteTextFieldEditorObserverTest, ShowURL) {
- EXPECT_CALL(field_observer_, ShowURL()).Times(1);
- [editor_ showURL:nil];
-}
-
// Test that -cut: is correctly delegated to the observer and clears
// the text field.
TEST_F(AutocompleteTextFieldEditorObserverTest, Cut) {
@@ -259,12 +253,10 @@ TEST_F(AutocompleteTextFieldEditorObserverTest, PasteAndGo) {
TEST_F(AutocompleteTextFieldEditorObserverTest, Menu) {
EXPECT_CALL(field_observer_, GetPasteActionStringId()).
WillOnce(Return(IDS_PASTE_AND_GO));
- EXPECT_CALL(field_observer_, ShouldEnableShowURL()).
- WillOnce(Return(true));
NSMenu* menu = MenuFromRightClick(editor_);
NSArray* items = [menu itemArray];
- ASSERT_EQ([items count], 7U);
+ ASSERT_EQ([items count], 6U);
// TODO(shess): Check the titles, too?
NSUInteger i = 0; // Use an index to make future changes easier.
EXPECT_EQ([[items objectAtIndex:i++] action], @selector(cut:));
@@ -272,7 +264,6 @@ TEST_F(AutocompleteTextFieldEditorObserverTest, Menu) {
EXPECT_EQ([[items objectAtIndex:i++] action], @selector(paste:));
EXPECT_EQ([[items objectAtIndex:i++] action], @selector(pasteAndGo:));
EXPECT_TRUE([[items objectAtIndex:i++] isSeparatorItem]);
- EXPECT_EQ([[items objectAtIndex:i++] action], @selector(showURL:));
EXPECT_EQ([[items objectAtIndex:i] tag], IDC_EDIT_SEARCH_ENGINES);
EXPECT_EQ([[items objectAtIndex:i++] action], @selector(commandDispatch:));
}
@@ -301,8 +292,6 @@ TEST_F(AutocompleteTextFieldEditorObserverTest, CanPasteAndGoValidate) {
EXPECT_CALL(field_observer_, GetPasteActionStringId())
.WillOnce(Return(IDS_PASTE_AND_GO));
EXPECT_CALL(field_observer_, CanPasteAndGo()).WillOnce(Return(true));
- EXPECT_CALL(field_observer_, ShouldEnableShowURL())
- .WillOnce(Return(false));
NSMenu* menu = MenuFromRightClick(editor_);
NSArray* items = [menu itemArray];
@@ -321,8 +310,6 @@ TEST_F(AutocompleteTextFieldEditorObserverTest, CannotPasteAndGoValidate) {
EXPECT_CALL(field_observer_, GetPasteActionStringId())
.WillOnce(Return(IDS_PASTE_AND_GO));
EXPECT_CALL(field_observer_, CanPasteAndGo()).WillOnce(Return(false));
- EXPECT_CALL(field_observer_, ShouldEnableShowURL())
- .WillOnce(Return(false));
NSMenu* menu = MenuFromRightClick(editor_);
NSArray* items = [menu itemArray];
@@ -336,23 +323,4 @@ TEST_F(AutocompleteTextFieldEditorObserverTest, CannotPasteAndGoValidate) {
}
}
-// Test that the menu validation works as expected when ShouldEnableShowURL().
-TEST_F(AutocompleteTextFieldEditorObserverTest, ShouldEnableShowURLValidate) {
- EXPECT_CALL(field_observer_, GetPasteActionStringId())
- .WillOnce(Return(IDS_PASTE_AND_GO));
- EXPECT_CALL(field_observer_, ShouldEnableShowURL())
- .WillRepeatedly(Return(true));
-
- NSMenu* menu = MenuFromRightClick(editor_);
- NSArray* items = [menu itemArray];
- ASSERT_EQ([items count], 7U);
- for (NSUInteger i = 0; i < [items count]; ++i) {
- NSMenuItem* item = [items objectAtIndex:i];
- if ([item action] == @selector(showURL:)) {
- EXPECT_TRUE([editor_ validateMenuItem:item]);
- break;
- }
- }
-}
-
} // namespace

Powered by Google App Engine
This is Rietveld 408576698