OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 void RestoreExtensionInfoIfNecessary(TemplateURL* template_url) override; | 168 void RestoreExtensionInfoIfNecessary(TemplateURL* template_url) override; |
169 }; | 169 }; |
170 | 170 |
171 void TestTemplateURLServiceClient::RestoreExtensionInfoIfNecessary( | 171 void TestTemplateURLServiceClient::RestoreExtensionInfoIfNecessary( |
172 TemplateURL* template_url) { | 172 TemplateURL* template_url) { |
173 const TemplateURLData& data = template_url->data(); | 173 const TemplateURLData& data = template_url->data(); |
174 GURL url(data.url()); | 174 GURL url(data.url()); |
175 if (url.SchemeIs(kOmniboxScheme)) { | 175 if (url.SchemeIs(kOmniboxScheme)) { |
176 const std::string& extension_id = url.host(); | 176 const std::string& extension_id = url.host(); |
177 template_url->set_extension_info( | 177 template_url->set_extension_info( |
178 base::MakeUnique<TemplateURL::AssociatedExtensionInfo>( | 178 base::MakeUnique<TemplateURL::AssociatedExtensionInfo>(extension_id)); |
179 TemplateURL::OMNIBOX_API_EXTENSION, extension_id)); | 179 template_url->set_type(TemplateURL::OMNIBOX_API_EXTENSION); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 } // namespace | 183 } // namespace |
184 | 184 |
185 | 185 |
186 // TemplateURLServiceSyncTest ------------------------------------------------- | 186 // TemplateURLServiceSyncTest ------------------------------------------------- |
187 | 187 |
188 class TemplateURLServiceSyncTest : public testing::Test { | 188 class TemplateURLServiceSyncTest : public testing::Test { |
189 public: | 189 public: |
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 | 2330 |
2331 TEST_F(TemplateURLServiceSyncTest, NonAsciiKeywordDoesNotCrash) { | 2331 TEST_F(TemplateURLServiceSyncTest, NonAsciiKeywordDoesNotCrash) { |
2332 model()->Add(CreateTestTemplateURL(UTF8ToUTF16("\xf0\xaf\xa6\x8d"), | 2332 model()->Add(CreateTestTemplateURL(UTF8ToUTF16("\xf0\xaf\xa6\x8d"), |
2333 "http://key1.com")); | 2333 "http://key1.com")); |
2334 syncer::SyncDataList initial_data = CreateInitialSyncData(); | 2334 syncer::SyncDataList initial_data = CreateInitialSyncData(); |
2335 | 2335 |
2336 model()->MergeDataAndStartSyncing( | 2336 model()->MergeDataAndStartSyncing( |
2337 syncer::SEARCH_ENGINES, initial_data, PassProcessor(), | 2337 syncer::SEARCH_ENGINES, initial_data, PassProcessor(), |
2338 CreateAndPassSyncErrorFactory()); | 2338 CreateAndPassSyncErrorFactory()); |
2339 } | 2339 } |
OLD | NEW |