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/search/instant_unittest_base.h" | 5 #include "chrome/browser/search/instant_unittest_base.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 43 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
44 void InstantUnitTestBase::SetUpWithoutQueryExtraction() { | 44 void InstantUnitTestBase::SetUpWithoutQueryExtraction() { |
45 SetUpHelper(); | 45 SetUpHelper(); |
46 } | 46 } |
47 #endif | 47 #endif |
48 | 48 |
49 void InstantUnitTestBase::SetUserSelectedDefaultSearchProvider( | 49 void InstantUnitTestBase::SetUserSelectedDefaultSearchProvider( |
50 const std::string& base_url) { | 50 const std::string& base_url) { |
51 TemplateURLData data; | 51 TemplateURLData data; |
| 52 data.SetShortName(base::UTF8ToUTF16(base_url)); |
52 data.SetKeyword(base::UTF8ToUTF16(base_url)); | 53 data.SetKeyword(base::UTF8ToUTF16(base_url)); |
53 data.SetURL(base_url + "url?bar={searchTerms}"); | 54 data.SetURL(base_url + "url?bar={searchTerms}"); |
54 data.instant_url = base_url + | 55 data.instant_url = base_url + |
55 "instant?{google:omniboxStartMarginParameter}{google:forceInstantResults}" | 56 "instant?{google:omniboxStartMarginParameter}{google:forceInstantResults}" |
56 "foo=foo#foo=foo&strk"; | 57 "foo=foo#foo=foo&strk"; |
57 data.new_tab_url = base_url + "newtab"; | 58 data.new_tab_url = base_url + "newtab"; |
58 data.alternate_urls.push_back(base_url + "alt#quux={searchTerms}"); | 59 data.alternate_urls.push_back(base_url + "alt#quux={searchTerms}"); |
59 data.search_terms_replacement_key = "strk"; | 60 data.search_terms_replacement_key = "strk"; |
60 | 61 |
61 TemplateURL* template_url = new TemplateURL(data); | 62 TemplateURL* template_url = new TemplateURL(data); |
(...skipping 28 matching lines...) Expand all Loading... |
90 void InstantUnitTestBase::SetUpHelper() { | 91 void InstantUnitTestBase::SetUpHelper() { |
91 BrowserWithTestWindowTest::SetUp(); | 92 BrowserWithTestWindowTest::SetUp(); |
92 | 93 |
93 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); | 94 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); |
94 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); | 95 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); |
95 | 96 |
96 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/"); | 97 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/"); |
97 SetUserSelectedDefaultSearchProvider("{google:baseURL}"); | 98 SetUserSelectedDefaultSearchProvider("{google:baseURL}"); |
98 instant_service_ = InstantServiceFactory::GetForProfile(profile()); | 99 instant_service_ = InstantServiceFactory::GetForProfile(profile()); |
99 } | 100 } |
OLD | NEW |