| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |