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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 UTF8ToUTF16(test_url_fake.spec()), &intents)); | 178 UTF8ToUTF16(test_url_fake.spec()), &intents)); |
179 EXPECT_EQ(0U, intents.size()); | 179 EXPECT_EQ(0U, intents.size()); |
180 | 180 |
181 intent.action = test_action_2; | 181 intent.action = test_action_2; |
182 ASSERT_TRUE(IntentsTable()->SetWebIntentService(intent)); | 182 ASSERT_TRUE(IntentsTable()->SetWebIntentService(intent)); |
183 EXPECT_TRUE(IntentsTable()->GetWebIntentServicesForURL( | 183 EXPECT_TRUE(IntentsTable()->GetWebIntentServicesForURL( |
184 UTF8ToUTF16(test_url.spec()), &intents)); | 184 UTF8ToUTF16(test_url.spec()), &intents)); |
185 ASSERT_EQ(2U, intents.size()); | 185 ASSERT_EQ(2U, intents.size()); |
186 } | 186 } |
187 | 187 |
| 188 #if defined(ENABLE_WEB_INTENTS) |
188 TEST_F(WebIntentsTableTest, DefaultServices) { | 189 TEST_F(WebIntentsTableTest, DefaultServices) { |
189 DefaultWebIntentService default_service; | 190 DefaultWebIntentService default_service; |
190 default_service.action = test_action; | 191 default_service.action = test_action; |
191 default_service.type = mime_image; | 192 default_service.type = mime_image; |
192 ASSERT_EQ(URLPattern::PARSE_SUCCESS, | 193 ASSERT_EQ(URLPattern::PARSE_SUCCESS, |
193 default_service.url_pattern.Parse(test_url.spec())); | 194 default_service.url_pattern.Parse(test_url.spec())); |
194 default_service.user_date = 1; | 195 default_service.user_date = 1; |
195 default_service.suppression = 4; | 196 default_service.suppression = 4; |
196 default_service.service_url = "service_url"; | 197 default_service.service_url = "service_url"; |
197 ASSERT_TRUE(IntentsTable()->SetDefaultService(default_service)); | 198 ASSERT_TRUE(IntentsTable()->SetDefaultService(default_service)); |
(...skipping 29 matching lines...) Expand all Loading... |
227 ASSERT_EQ(0U, defaults.size()); | 228 ASSERT_EQ(0U, defaults.size()); |
228 | 229 |
229 defaults.clear(); | 230 defaults.clear(); |
230 ASSERT_TRUE(IntentsTable()->GetDefaultServices(test_action_2, &defaults)); | 231 ASSERT_TRUE(IntentsTable()->GetDefaultServices(test_action_2, &defaults)); |
231 ASSERT_EQ(1U, defaults.size()); | 232 ASSERT_EQ(1U, defaults.size()); |
232 | 233 |
233 defaults.clear(); | 234 defaults.clear(); |
234 ASSERT_TRUE(IntentsTable()->GetAllDefaultServices(&defaults)); | 235 ASSERT_TRUE(IntentsTable()->GetAllDefaultServices(&defaults)); |
235 ASSERT_EQ(1U, defaults.size()); | 236 ASSERT_EQ(1U, defaults.size()); |
236 } | 237 } |
| 238 #endif // defined(ENABLE_WEB_INTENTS) |
237 | 239 |
238 } // namespace | 240 } // namespace |
OLD | NEW |