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

Unified Diff: chrome/browser/webdata/web_intents_table_unittest.cc

Issue 8144013: Add a check to the registry before the intent infobar is shown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 9 years, 2 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/webdata/web_intents_table_unittest.cc
diff --git a/chrome/browser/webdata/web_intents_table_unittest.cc b/chrome/browser/webdata/web_intents_table_unittest.cc
index 3e10b19b48ede4e654023906c5526f9dacdfabcc..18c9d4dc706f53a02d795c974deb6ccf057babbf 100644
--- a/chrome/browser/webdata/web_intents_table_unittest.cc
+++ b/chrome/browser/webdata/web_intents_table_unittest.cc
@@ -18,6 +18,7 @@
namespace {
GURL test_url("http://google.com/");
+GURL test_url_fake("http://fakegoogle.com/");
string16 test_action = ASCIIToUTF16("http://webintents.org/intents/share");
string16 test_action_2 = ASCIIToUTF16("http://webintents.org/intents/view");
string16 test_title = ASCIIToUTF16("Test WebIntent");
@@ -154,4 +155,26 @@ TEST_F(WebIntentsTableTest, DispositionToStringMapping) {
EXPECT_EQ(WebIntentServiceData::DISPOSITION_INLINE, intents[0].disposition);
EXPECT_EQ(WebIntentServiceData::DISPOSITION_WINDOW, intents[1].disposition);
}
+
+TEST_F(WebIntentsTableTest, GetByURL) {
+ WebIntentServiceData intent = MakeIntent(test_url, test_action, mime_image,
+ test_title);
+ ASSERT_TRUE(IntentsTable()->SetWebIntent(intent));
+
+ std::vector<WebIntentServiceData> intents;
+ EXPECT_TRUE(IntentsTable()->GetWebIntentsForURL(
+ test_action, UTF8ToUTF16(test_url.spec()), &intents));
+ ASSERT_EQ(1U, intents.size());
+ EXPECT_EQ(intent, intents[0]);
+
+ intents.clear();
+ EXPECT_TRUE(IntentsTable()->GetWebIntentsForURL(
+ test_action, UTF8ToUTF16(test_url_fake.spec()), &intents));
+ EXPECT_EQ(0U, intents.size());
+
+ EXPECT_TRUE(IntentsTable()->GetWebIntentsForURL(
+ test_action_2, UTF8ToUTF16(test_url.spec()), &intents));
+ EXPECT_EQ(0U, intents.size());
+}
+
} // namespace
« chrome/browser/webdata/web_intents_table.cc ('K') | « chrome/browser/webdata/web_intents_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698