Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1022)

Side by Side Diff: chrome/browser/ui/search/search_ipc_router_policy_unittest.cc

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/search/search_ipc_router.h" 5 #include "chrome/browser/ui/search/search_ipc_router.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" 8 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h"
9 #include "chrome/browser/ui/search/search_tab_helper.h" 9 #include "chrome/browser/ui/search/search_tab_helper.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
11 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 class SearchIPCRouterPolicyTest : public ChromeRenderViewHostTestHarness { 16 class SearchIPCRouterPolicyTest : public ChromeRenderViewHostTestHarness {
17 public: 17 public:
18 virtual void SetUp() { 18 virtual void SetUp() {
19 CommandLine::ForCurrentProcess()->AppendSwitch(
20 switches::kEnableInstantExtendedAPI);
21 ChromeRenderViewHostTestHarness::SetUp(); 19 ChromeRenderViewHostTestHarness::SetUp();
22 SearchTabHelper::CreateForWebContents(web_contents()); 20 SearchTabHelper::CreateForWebContents(web_contents());
23 } 21 }
24 22
25 SearchTabHelper* GetSearchTabHelper() { 23 SearchTabHelper* GetSearchTabHelper() {
26 SearchTabHelper* search_tab_helper = 24 SearchTabHelper* search_tab_helper =
27 SearchTabHelper::FromWebContents(web_contents()); 25 SearchTabHelper::FromWebContents(web_contents());
28 EXPECT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); 26 EXPECT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper);
29 return search_tab_helper; 27 return search_tab_helper;
30 } 28 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ShouldSendThemeBackgroundInfo()); 181 ShouldSendThemeBackgroundInfo());
184 } 182 }
185 183
186 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) { 184 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) {
187 NavigateAndCommit(GURL("chrome-search://foo/bar")); 185 NavigateAndCommit(GURL("chrome-search://foo/bar"));
188 SearchTabHelper* search_tab_helper = 186 SearchTabHelper* search_tab_helper =
189 SearchTabHelper::FromWebContents(web_contents()); 187 SearchTabHelper::FromWebContents(web_contents());
190 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); 188 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper);
191 EXPECT_TRUE(search_tab_helper->ipc_router().policy()->ShouldSubmitQuery()); 189 EXPECT_TRUE(search_tab_helper->ipc_router().policy()->ShouldSubmitQuery());
192 } 190 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698