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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/json/json_file_value_serializer.h" | 7 #include "base/json/json_file_value_serializer.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 TestConsumer consumer; | 233 TestConsumer consumer; |
234 registry_.GetIntentServicesForExtensionFilter( | 234 registry_.GetIntentServicesForExtensionFilter( |
235 ASCIIToUTF16("http://webintents.org/edit"), | 235 ASCIIToUTF16("http://webintents.org/edit"), |
236 ASCIIToUTF16("image/*"), | 236 ASCIIToUTF16("image/*"), |
237 edit_extension->id(), | 237 edit_extension->id(), |
238 base::Bind(&TestConsumer::OnIntentsQueryDone, | 238 base::Bind(&TestConsumer::OnIntentsQueryDone, |
239 base::Unretained(&consumer))); | 239 base::Unretained(&consumer))); |
240 consumer.WaitForData(); | 240 consumer.WaitForData(); |
241 ASSERT_EQ(1U, consumer.services_.size()); | 241 ASSERT_EQ(1U, consumer.services_.size()); |
| 242 |
| 243 EXPECT_EQ(edit_extension->url().spec() + "services/edit", |
| 244 consumer.services_[0].service_url.spec()); |
242 } | 245 } |
243 | 246 |
244 TEST_F(WebIntentsRegistryTest, GetAllIntents) { | 247 TEST_F(WebIntentsRegistryTest, GetAllIntents) { |
245 webkit_glue::WebIntentServiceData service; | 248 webkit_glue::WebIntentServiceData service; |
246 service.service_url = GURL("http://google.com"); | 249 service.service_url = GURL("http://google.com"); |
247 service.action = ASCIIToUTF16("share"); | 250 service.action = ASCIIToUTF16("share"); |
248 service.type = ASCIIToUTF16("image/*"); | 251 service.type = ASCIIToUTF16("image/*"); |
249 service.title = ASCIIToUTF16("Google's Sharing Service"); | 252 service.title = ASCIIToUTF16("Google's Sharing Service"); |
250 registry_.RegisterIntentService(service); | 253 registry_.RegisterIntentService(service); |
251 | 254 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 TestConsumer consumer; | 635 TestConsumer consumer; |
633 registry_.GetIntentServices(ASCIIToUTF16("http://webintents.org/share"), | 636 registry_.GetIntentServices(ASCIIToUTF16("http://webintents.org/share"), |
634 ASCIIToUTF16("image/*"), | 637 ASCIIToUTF16("image/*"), |
635 base::Bind(&TestConsumer::OnIntentsQueryDone, | 638 base::Bind(&TestConsumer::OnIntentsQueryDone, |
636 base::Unretained(&consumer))); | 639 base::Unretained(&consumer))); |
637 | 640 |
638 consumer.WaitForData(); | 641 consumer.WaitForData(); |
639 ASSERT_EQ(1U, consumer.services_.size()); | 642 ASSERT_EQ(1U, consumer.services_.size()); |
640 EXPECT_EQ(ASCIIToUTF16("image/png,image/jpg"), consumer.services_[0].type); | 643 EXPECT_EQ(ASCIIToUTF16("image/png,image/jpg"), consumer.services_[0].type); |
641 } | 644 } |
OLD | NEW |