| 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 .WillOnce(testing::Return(false)); | 604 .WillOnce(testing::Return(false)); |
| 605 | 605 |
| 606 GetSearchIPCRouter().SetPromoInformation(false); | 606 GetSearchIPCRouter().SetPromoInformation(false); |
| 607 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxPromoInformation::ID)); | 607 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxPromoInformation::ID)); |
| 608 } | 608 } |
| 609 | 609 |
| 610 TEST_F(SearchIPCRouterTest, | 610 TEST_F(SearchIPCRouterTest, |
| 611 SendSetDisplayInstantResultsMsg_EnableInstantOnResultsPage) { | 611 SendSetDisplayInstantResultsMsg_EnableInstantOnResultsPage) { |
| 612 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( | 612 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( |
| 613 "EmbeddedSearch", | 613 "EmbeddedSearch", |
| 614 "Group1 espv:42 suppress_on_srp:0 prefetch_results_srp:1")); | 614 "Group1 espv:42 query_extraction:1 prefetch_results_srp:1")); |
| 615 NavigateAndCommitActiveTab(GURL("https://foo.com/url?espv&bar=abc")); | 615 NavigateAndCommitActiveTab(GURL("https://foo.com/url?espv&bar=abc")); |
| 616 | 616 |
| 617 // Make sure ChromeViewMsg_SearchBoxSetDisplayInstantResults message param is | 617 // Make sure ChromeViewMsg_SearchBoxSetDisplayInstantResults message param is |
| 618 // set to true if the underlying page is a results page and | 618 // set to true if the underlying page is a results page and |
| 619 // "prefetch_results_srp" flag is enabled via field trials. | 619 // "prefetch_results_srp" flag is enabled via field trials. |
| 620 VerifyDisplayInstantResultsMsg(true); | 620 VerifyDisplayInstantResultsMsg(true); |
| 621 } | 621 } |
| 622 | 622 |
| 623 TEST_F(SearchIPCRouterTest, | 623 TEST_F(SearchIPCRouterTest, |
| 624 SendSetDisplayInstantResultsMsg_DisableInstantOnResultsPage) { | 624 SendSetDisplayInstantResultsMsg_DisableInstantOnResultsPage) { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); | 776 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); |
| 777 SetupMockDelegateAndPolicy(); | 777 SetupMockDelegateAndPolicy(); |
| 778 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); | 778 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); |
| 779 EXPECT_CALL(*policy, ShouldSendToggleVoiceSearch()).Times(1) | 779 EXPECT_CALL(*policy, ShouldSendToggleVoiceSearch()).Times(1) |
| 780 .WillOnce(testing::Return(false)); | 780 .WillOnce(testing::Return(false)); |
| 781 | 781 |
| 782 process()->sink().ClearMessages(); | 782 process()->sink().ClearMessages(); |
| 783 GetSearchIPCRouter().ToggleVoiceSearch(); | 783 GetSearchIPCRouter().ToggleVoiceSearch(); |
| 784 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxToggleVoiceSearch::ID)); | 784 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxToggleVoiceSearch::ID)); |
| 785 } | 785 } |
| OLD | NEW |