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

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

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused. 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 <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 EXPECT_CALL(*policy, ShouldSendSetPromoInformation()).Times(1) 663 EXPECT_CALL(*policy, ShouldSendSetPromoInformation()).Times(1)
664 .WillOnce(testing::Return(false)); 664 .WillOnce(testing::Return(false));
665 665
666 GetSearchTabHelper(contents)->ipc_router().SetPromoInformation(false); 666 GetSearchTabHelper(contents)->ipc_router().SetPromoInformation(false);
667 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxPromoInformation::ID)); 667 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxPromoInformation::ID));
668 } 668 }
669 669
670 TEST_F(SearchIPCRouterTest, 670 TEST_F(SearchIPCRouterTest,
671 SendSetDisplayInstantResultsMsg_EnableInstantOnResultsPage) { 671 SendSetDisplayInstantResultsMsg_EnableInstantOnResultsPage) {
672 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( 672 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
673 "EmbeddedSearch", "Group1 espv:42 prefetch_results_srp:1")); 673 "EmbeddedSearch",
674 "Group1 espv:42 query_extraction:1 prefetch_results_srp:1"));
674 NavigateAndCommitActiveTab(GURL("https://foo.com/url?espv&bar=abc")); 675 NavigateAndCommitActiveTab(GURL("https://foo.com/url?espv&bar=abc"));
675 676
676 // Make sure ChromeViewMsg_SearchBoxSetDisplayInstantResults message param is 677 // Make sure ChromeViewMsg_SearchBoxSetDisplayInstantResults message param is
677 // set to true if the underlying page is a results page and 678 // set to true if the underlying page is a results page and
678 // "prefetch_results_srp" flag is enabled via field trials. 679 // "prefetch_results_srp" flag is enabled via field trials.
679 VerifyDisplayInstantResultsMsg(true); 680 VerifyDisplayInstantResultsMsg(true);
680 } 681 }
681 682
682 TEST_F(SearchIPCRouterTest, 683 TEST_F(SearchIPCRouterTest,
683 SendSetDisplayInstantResultsMsg_DisableInstantOnResultsPage) { 684 SendSetDisplayInstantResultsMsg_DisableInstantOnResultsPage) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 content::WebContents* contents = web_contents(); 841 content::WebContents* contents = web_contents();
841 SetupMockDelegateAndPolicy(contents); 842 SetupMockDelegateAndPolicy(contents);
842 MockSearchIPCRouterPolicy* policy = 843 MockSearchIPCRouterPolicy* policy =
843 GetSearchIPCRouterPolicy(contents); 844 GetSearchIPCRouterPolicy(contents);
844 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1) 845 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1)
845 .WillOnce(testing::Return(false)); 846 .WillOnce(testing::Return(false));
846 847
847 GetSearchTabHelper(contents)->ipc_router().Submit(string16()); 848 GetSearchTabHelper(contents)->ipc_router().Submit(string16());
848 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSubmit::ID)); 849 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSubmit::ID));
849 } 850 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_ipc_router_policy_unittest.cc ('k') | chrome/browser/ui/search/search_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698