This source file includes following definitions.
- IN_PROC_BROWSER_TEST_F
#include "chrome/browser/ui/browser_command_controller.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/test_utils.h"
typedef InProcessBrowserTest BrowserCommandControllerBrowserTest;
IN_PROC_BROWSER_TEST_F(BrowserCommandControllerBrowserTest, DisableFind) {
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FIND));
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
MockTabModalConfirmDialogDelegate* delegate =
new MockTabModalConfirmDialogDelegate(web_contents, NULL);
TabModalConfirmDialog::Create(delegate, web_contents);
EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FIND));
AddBlankTabAndShow(browser());
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FIND));
browser()->tab_strip_model()->ActivateTabAt(0, false);
EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FIND));
delegate->Cancel();
content::RunAllPendingInMessageLoop();
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FIND));
}