This source file includes following definitions.
- TEST_F
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/search/search_model.h"
#include "chrome/browser/ui/search/search_tab_helper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/browser_with_test_window_test.h"
typedef BrowserWithTestWindowTest SearchDelegateTest;
TEST_F(SearchDelegateTest, SearchModel) {
EXPECT_TRUE(browser()->search_model()->mode().is_default());
AddTab(browser(), GURL("http://foo/0"));
content::WebContents* web_contents =
browser()->tab_strip_model()->GetWebContentsAt(0);
SearchTabHelper::FromWebContents(web_contents)->model()->
SetMode(SearchMode(SearchMode::MODE_NTP, SearchMode::ORIGIN_NTP));
EXPECT_TRUE(browser()->search_model()->mode().is_ntp());
AddTab(browser(), GURL("http://foo/1"));
browser()->tab_strip_model()->ActivateTabAt(1, true);
web_contents = browser()->tab_strip_model()->GetWebContentsAt(1);
SearchTabHelper::FromWebContents(web_contents)->model()->
SetMode(SearchMode(SearchMode::MODE_SEARCH_RESULTS,
SearchMode::ORIGIN_DEFAULT));
EXPECT_TRUE(browser()->search_model()->mode().is_search());
web_contents = browser()->tab_strip_model()->GetWebContentsAt(0);
SearchTabHelper::FromWebContents(web_contents)->model()->
SetMode(SearchMode(SearchMode::MODE_NTP, SearchMode::ORIGIN_NTP));
EXPECT_TRUE(browser()->search_model()->mode().is_search());
}