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

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

Issue 73613002: InstantExtended: remove old flags, add new flag for query extraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 1 month 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 "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" 9 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h"
10 #include "chrome/browser/ui/search/search_tab_helper.h" 10 #include "chrome/browser/ui/search/search_tab_helper.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" 11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
13 #include "chrome/common/url_constants.h" 13 #include "chrome/common/url_constants.h"
14 #include "chrome/test/base/browser_with_test_window_test.h" 14 #include "chrome/test/base/browser_with_test_window_test.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 class SearchIPCRouterPolicyTest : public BrowserWithTestWindowTest { 18 class SearchIPCRouterPolicyTest : public BrowserWithTestWindowTest {
19 public: 19 public:
20 virtual void SetUp() { 20 virtual void SetUp() {
21 CommandLine::ForCurrentProcess()->AppendSwitch(
22 switches::kEnableInstantExtendedAPI);
23 BrowserWithTestWindowTest::SetUp(); 21 BrowserWithTestWindowTest::SetUp();
24 AddTab(browser(), GURL("chrome://blank")); 22 AddTab(browser(), GURL("chrome://blank"));
25 SearchTabHelper::CreateForWebContents(web_contents()); 23 SearchTabHelper::CreateForWebContents(web_contents());
26 } 24 }
27 25
28 content::WebContents* web_contents() { 26 content::WebContents* web_contents() {
29 return browser()->tab_strip_model()->GetActiveWebContents(); 27 return browser()->tab_strip_model()->GetActiveWebContents();
30 } 28 }
31 29
32 SearchIPCRouter::Policy* GetSearchIPCRouterPolicy() { 30 SearchIPCRouter::Policy* GetSearchIPCRouterPolicy() {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 206
209 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) { 207 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) {
210 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 208 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
211 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery()); 209 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery());
212 } 210 }
213 211
214 TEST_F(SearchIPCRouterPolicyTest, SendToggleVoiceSearch) { 212 TEST_F(SearchIPCRouterPolicyTest, SendToggleVoiceSearch) {
215 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); 213 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
216 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendToggleVoiceSearch()); 214 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendToggleVoiceSearch());
217 } 215 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_delegate_unittest.cc ('k') | chrome/browser/ui/search/search_ipc_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698