Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2773)

Unified Diff: chrome/browser/intents/web_intents_registry_unittest.cc

Issue 7633011: Added WebIntents GetAll support (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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]);
+}

Powered by Google App Engine
This is Rietveld 408576698