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 5a5e6f62b54186a7e1dc76db3cb577aa0307b5ac..a0bfb44571e28c8fb3d841cde99343f17aa4360e 100644 |
| --- a/chrome/browser/intents/web_intents_registry_unittest.cc |
| +++ b/chrome/browser/intents/web_intents_registry_unittest.cc |
| @@ -102,3 +102,28 @@ TEST_F(WebIntentsRegistryTest, BasicTests) { |
| consumer.WaitForData(); |
| EXPECT_EQ(1U, consumer.intents_.size()); |
| } |
| + |
| +TEST_F(WebIntentsRegistryTest, GetAllIntents) { |
| + WebIntentData intent; |
| + intent.service_url = GURL("http://google.com"); |
| + intent.action = ASCIIToUTF16("share"); |
| + intent.type = ASCIIToUTF16("image/*"); |
| + intent.title = ASCIIToUTF16("Google's Sharing Service"); |
| + |
| + registry_.RegisterIntentProvider(intent); |
| + |
| + intent.action = ASCIIToUTF16("search"); |
| + |
|
Greg Billock
2011/08/12 17:34:25
Need another "RegisterIntentProvider" here?
|
| + TestConsumer consumer; |
| + consumer.expected_id_ = registry_.GetAllIntentProviders(&consumer); |
| + consumer.WaitForData(); |
| + EXPECT_EQ(2U, consumer.intents_.size()); |
|
Greg Billock
2011/08/12 17:34:25
Looks like it should be ASSERT
groby-ooo-7-16
2011/08/12 19:51:38
Done.
|
| + |
| + if (consumer.intents_[0].action != ASCIIToUTF16("share")) |
| + std::swap(consumer.intents_[0],consumer.intents_[1]); |
| + |
| + EXPECT_EQ(intent, consumer.intents_[0]); |
| + |
| + intent.action = ASCIIToUTF16("search"); |
| + EXPECT_EQ(intent, consumer.intents_[1]); |
| +} |