This source file includes following definitions.
- IN_PROC_BROWSER_TEST_F
#include "chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/test/base/ui_test_utils.h"
IN_PROC_BROWSER_TEST_F(OmniboxApiTest, PopupStaysClosed) {
ASSERT_TRUE(RunExtensionTest("omnibox")) << message_;
ui_test_utils::WaitForTemplateURLServiceToLoad(
TemplateURLServiceFactory::GetForProfile(browser()->profile()));
LocationBar* location_bar = GetLocationBar(browser());
OmniboxView* omnibox_view = location_bar->GetOmniboxView();
AutocompleteController* autocomplete_controller =
GetAutocompleteController(browser());
OmniboxPopupModel* popup_model = omnibox_view->model()->popup_model();
omnibox_view->OnBeforePossibleChange();
omnibox_view->SetUserText(base::ASCIIToUTF16("keyword comman"));
omnibox_view->OnAfterPossibleChange();
WaitForAutocompleteDone(autocomplete_controller);
EXPECT_TRUE(autocomplete_controller->done());
EXPECT_TRUE(popup_model->IsOpen());
ResultCatcher catcher;
autocomplete_controller->Start(
AutocompleteInput(base::ASCIIToUTF16("keyword command"),
base::string16::npos, base::string16(), GURL(),
AutocompleteInput::NTP, true, false, true,
AutocompleteInput::ALL_MATCHES));
location_bar->AcceptInput();
WaitForAutocompleteDone(autocomplete_controller);
EXPECT_TRUE(autocomplete_controller->done());
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
EXPECT_FALSE(popup_model->IsOpen());
}