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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_browsertest.cc

Issue 2435103002: Omnibox: Preserve display text and select all on a focus search (Closed)
Patch Set: Use display_text.length() as caret pos for KEYBOARD_SHORTCUT Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 omnibox_model->ClearKeyword(); 322 omnibox_model->ClearKeyword();
323 323
324 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); 324 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid());
325 EXPECT_EQ(query_text, omnibox_view->GetText()); 325 EXPECT_EQ(query_text, omnibox_view->GetText());
326 EXPECT_EQ(base::string16(), omnibox_model->keyword()); 326 EXPECT_EQ(base::string16(), omnibox_model->keyword());
327 EXPECT_FALSE(omnibox_model->is_keyword_hint()); 327 EXPECT_FALSE(omnibox_model->is_keyword_hint());
328 EXPECT_FALSE(omnibox_model->is_keyword_selected()); 328 EXPECT_FALSE(omnibox_model->is_keyword_selected());
329 329
330 omnibox_view->RevertAll(); 330 omnibox_view->RevertAll();
331 } 331 }
332
333 // Calling FocusSearch() when the permanent URL is showing should result in an
334 // empty query string.
335 {
336 FocusSearchCheckPreconditions();
337
338 omnibox_model->UpdatePermanentText();
339 EXPECT_EQ(base::ASCIIToUTF16(url::kAboutBlankURL), omnibox_view->GetText());
340
341 location_bar->FocusSearch();
342 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid());
343 EXPECT_EQ(base::string16(), omnibox_view->GetText());
344 EXPECT_EQ(default_search_keyword, omnibox_model->keyword());
345 EXPECT_FALSE(omnibox_model->is_keyword_hint());
346 EXPECT_TRUE(omnibox_model->is_keyword_selected());
347
348 omnibox_view->RevertAll();
349 }
332 } 350 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698