Chromium Code Reviews| Index: chrome/browser/intents/web_intents_registry_unittest.cc |
| diff --git a/chrome/browser/intents/web_intents_registry_unittest.cc b/chrome/browser/intents/web_intents_registry_unittest.cc |
| index 6ba804bdad667a30f1dc97a62433dedbe97f53b0..46a71067bfeb304886e57a7b296566ea135fc1cf 100644 |
| --- a/chrome/browser/intents/web_intents_registry_unittest.cc |
| +++ b/chrome/browser/intents/web_intents_registry_unittest.cc |
| @@ -734,3 +734,51 @@ TEST_F(WebIntentsRegistryTest, GetIntentsCollapsesEquivalentIntents) { |
| ASSERT_EQ(1U, consumer.services_.size()); |
| EXPECT_EQ(ASCIIToUTF16("image/png,image/jpg"), consumer.services_[0].type); |
| } |
| + |
| +TEST_F(WebIntentsRegistryTest, UnregisterDefaultIntentServicesForServiceURL) { |
|
James Hawkins
2012/08/08 16:22:37
nit: Document what this method is testing.
I'd re
Steve McKay
2012/08/08 17:54:42
Revised method name, leaving this method name as-i
|
| + |
|
James Hawkins
2012/08/08 16:22:37
nit: Remove blank line.
Steve McKay
2012/08/08 17:54:42
Done.
|
| + const GURL service_url_0("http://jibfest.com/dozer"); |
| + const GURL service_url_1("http://kittyfizzer.com/fizz"); |
| + |
| + DefaultWebIntentService s0; |
| + s0.action = ASCIIToUTF16("share"); |
| + s0.type = ASCIIToUTF16("text/*"); |
| + // Values here are just dummies to test for preservation. |
| + s0.user_date = 1; |
| + s0.suppression = 4; |
| + s0.service_url = service_url_0.spec(); |
| + registry_.RegisterDefaultIntentService(s0); |
| + |
| + DefaultWebIntentService s1; |
| + s1.action = ASCIIToUTF16("whack"); |
| + s1.type = ASCIIToUTF16("text/*"); |
| + // Values here are just dummies to test for preservation. |
| + s1.user_date = 1; |
| + s1.suppression = 4; |
| + s1.service_url = service_url_1.spec(); |
| + registry_.RegisterDefaultIntentService(s1); |
| + |
| + DefaultServiceListConsumer consumer; |
| + |
| + // Test we can retrieve default entries by action. |
|
James Hawkins
2012/08/08 16:22:37
nit: Reword to remove pronoun.
Steve McKay
2012/08/08 17:54:42
Nuked the invalid comment.
|
| + registry_.GetAllDefaultIntentServices( |
| + base::Bind(&DefaultServiceListConsumer::Accept, |
| + base::Unretained(&consumer))); |
| + |
| + consumer.WaitForData(); |
| + |
| + ASSERT_EQ(2U, consumer.services_.size()); |
| + |
| + registry_.UnregisterDefaultIntentServicesForServiceURL(service_url_0); |
| + MessageLoop::current()->RunAllPending(); |
| + |
| + // Test we can retrieve default entries by action. |
|
Steve McKay
2012/08/08 17:54:42
Nuked this too.
|
| + registry_.GetAllDefaultIntentServices( |
| + base::Bind(&DefaultServiceListConsumer::Accept, |
| + base::Unretained(&consumer))); |
| + |
| + consumer.WaitForData(); |
| + |
| + ASSERT_EQ(1U, consumer.services_.size()); |
| + EXPECT_EQ(service_url_1.spec(), consumer.services_[0].service_url); |
| +} |