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) | |
189 TEST_F(WebIntentsTableTest, DefaultServices) { | 188 TEST_F(WebIntentsTableTest, DefaultServices) { |
190 DefaultWebIntentService default_service; | 189 DefaultWebIntentService default_service; |
191 default_service.action = test_action; | 190 default_service.action = test_action; |
192 default_service.type = mime_image; | 191 default_service.type = mime_image; |
193 ASSERT_EQ(URLPattern::PARSE_SUCCESS, | 192 ASSERT_EQ(URLPattern::PARSE_SUCCESS, |
194 default_service.url_pattern.Parse(test_url.spec())); | 193 default_service.url_pattern.Parse(test_url.spec())); |
195 default_service.user_date = 1; | 194 default_service.user_date = 1; |
196 default_service.suppression = 4; | 195 default_service.suppression = 4; |
197 default_service.service_url = "service_url"; | 196 default_service.service_url = "service_url"; |
198 ASSERT_TRUE(IntentsTable()->SetDefaultService(default_service)); | 197 ASSERT_TRUE(IntentsTable()->SetDefaultService(default_service)); |
(...skipping 29 matching lines...) Expand all Loading... |
228 ASSERT_EQ(0U, defaults.size()); | 227 ASSERT_EQ(0U, defaults.size()); |
229 | 228 |
230 defaults.clear(); | 229 defaults.clear(); |
231 ASSERT_TRUE(IntentsTable()->GetDefaultServices(test_action_2, &defaults)); | 230 ASSERT_TRUE(IntentsTable()->GetDefaultServices(test_action_2, &defaults)); |
232 ASSERT_EQ(1U, defaults.size()); | 231 ASSERT_EQ(1U, defaults.size()); |
233 | 232 |
234 defaults.clear(); | 233 defaults.clear(); |
235 ASSERT_TRUE(IntentsTable()->GetAllDefaultServices(&defaults)); | 234 ASSERT_TRUE(IntentsTable()->GetAllDefaultServices(&defaults)); |
236 ASSERT_EQ(1U, defaults.size()); | 235 ASSERT_EQ(1U, defaults.size()); |
237 } | 236 } |
238 #endif // defined(ENABLE_WEB_INTENTS) | |
239 | 237 |
240 } // namespace | 238 } // namespace |
OLD | NEW |