diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 08:53:06 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 08:53:06 +0000 |
commit | e1c10f1862e3ff35c491657ec155ba22c518ada7 (patch) | |
tree | 5b2e2c4364c088a468dd133d064a70f171c056fd /chrome/test/in_process_browser_test.cc | |
parent | fb66d44b3da0c60bce679cded13d6ddffca0a8f9 (diff) | |
download | chromium_src-e1c10f1862e3ff35c491657ec155ba22c518ada7.zip chromium_src-e1c10f1862e3ff35c491657ec155ba22c518ada7.tar.gz chromium_src-e1c10f1862e3ff35c491657ec155ba22c518ada7.tar.bz2 |
Support alt-f4 when omnibox is focused in popup
BUG=54435
TEST=open the url javascript:window.open('http://www.google.com/', '', 'foobar'); (this should open a popup), click on the omnibox to set focus to it, and press Alt-F4. The popup should close.
Review URL: http://codereview.chromium.org/3345015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/in_process_browser_test.cc')
-rw-r--r-- | chrome/test/in_process_browser_test.cc | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index a930da2..0895950 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -71,6 +71,23 @@ class LinuxHostInit { #include "chrome/browser/chromeos/cros/cros_library.h" #endif // defined(OS_CHROMEOS) +namespace { + +void InitializeBrowser(Browser* browser) { + browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), + PageTransition::START_PAGE, -1, + TabStripModel::ADD_SELECTED, NULL, std::string(), + &browser); + + // Wait for the page to finish loading. + ui_test_utils::WaitForNavigation( + &browser->GetSelectedTabContents()->controller()); + + browser->window()->Show(); +} + +} // namespace + extern int BrowserMain(const MainFunctionParams&); const wchar_t kUnitTestShowWindows[] = L"show-windows"; @@ -259,18 +276,13 @@ void InProcessBrowserTest::TearDown() { // finish loading and shows the browser. Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { Browser* browser = Browser::Create(profile); + InitializeBrowser(browser); + return browser; +} - browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), - PageTransition::START_PAGE, -1, - TabStripModel::ADD_SELECTED, NULL, std::string(), - &browser); - - // Wait for the page to finish loading. - ui_test_utils::WaitForNavigation( - &browser->GetSelectedTabContents()->controller()); - - browser->window()->Show(); - +Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { + Browser* browser = Browser::CreateForPopup(profile); + InitializeBrowser(browser); return browser; } |