| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service); | 104 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service); |
| 105 | 105 |
| 106 TemplateURLData data; | 106 TemplateURLData data; |
| 107 data.SetURL("http://foo.com/url?bar={searchTerms}"); | 107 data.SetURL("http://foo.com/url?bar={searchTerms}"); |
| 108 data.instant_url = "http://foo.com/instant?" | 108 data.instant_url = "http://foo.com/instant?" |
| 109 "{google:omniboxStartMarginParameter}foo=foo#foo=foo&espv"; | 109 "{google:omniboxStartMarginParameter}foo=foo#foo=foo&espv"; |
| 110 data.new_tab_url = "https://foo.com/newtab?espv"; | 110 data.new_tab_url = "https://foo.com/newtab?espv"; |
| 111 data.alternate_urls.push_back("http://foo.com/alt#quux={searchTerms}"); | 111 data.alternate_urls.push_back("http://foo.com/alt#quux={searchTerms}"); |
| 112 data.search_terms_replacement_key = "espv"; | 112 data.search_terms_replacement_key = "espv"; |
| 113 | 113 |
| 114 TemplateURL* template_url = new TemplateURL(profile(), data); | 114 TemplateURL* template_url = new TemplateURL(data); |
| 115 // Takes ownership of |template_url|. | 115 // Takes ownership of |template_url|. |
| 116 template_url_service->Add(template_url); | 116 template_url_service->Add(template_url); |
| 117 template_url_service->SetUserSelectedDefaultSearchProvider(template_url); | 117 template_url_service->SetUserSelectedDefaultSearchProvider(template_url); |
| 118 process()->sink().ClearMessages(); | 118 process()->sink().ClearMessages(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 content::WebContents* web_contents() { | 121 content::WebContents* web_contents() { |
| 122 return browser()->tab_strip_model()->GetActiveWebContents(); | 122 return browser()->tab_strip_model()->GetActiveWebContents(); |
| 123 } | 123 } |
| 124 | 124 |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); | 908 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); |
| 909 SetupMockDelegateAndPolicy(); | 909 SetupMockDelegateAndPolicy(); |
| 910 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); | 910 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); |
| 911 EXPECT_CALL(*policy, ShouldSendToggleVoiceSearch()).Times(1) | 911 EXPECT_CALL(*policy, ShouldSendToggleVoiceSearch()).Times(1) |
| 912 .WillOnce(testing::Return(false)); | 912 .WillOnce(testing::Return(false)); |
| 913 | 913 |
| 914 process()->sink().ClearMessages(); | 914 process()->sink().ClearMessages(); |
| 915 GetSearchIPCRouter().ToggleVoiceSearch(); | 915 GetSearchIPCRouter().ToggleVoiceSearch(); |
| 916 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxToggleVoiceSearch::ID)); | 916 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxToggleVoiceSearch::ID)); |
| 917 } | 917 } |
| OLD | NEW |