| 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 <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 Loading... |
| 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 } |
| OLD | NEW |