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

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: Fix provider to service in comments. Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/webdata/web_intents_table.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7a1859f628e1ff5ee04b499456ad0eb0632b30de..32edcd06a0da614935b9bb7c4eb9c5e823fc8eda 100644
--- a/chrome/browser/webdata/web_intents_table_unittest.cc
+++ b/chrome/browser/webdata/web_intents_table_unittest.cc
@@ -20,6 +20,7 @@ using webkit_glue::WebIntentServiceData;
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");
@@ -157,4 +158,28 @@ TEST_F(WebIntentsTableTest, DispositionToStringMapping) {
EXPECT_EQ(WebIntentServiceData::DISPOSITION_INLINE, services[0].disposition);
EXPECT_EQ(WebIntentServiceData::DISPOSITION_WINDOW, services[1].disposition);
}
+
+TEST_F(WebIntentsTableTest, GetByURL) {
+ WebIntentServiceData intent = MakeIntentService(
+ test_url, test_action, mime_image, test_title);
+ ASSERT_TRUE(IntentsTable()->SetWebIntentService(intent));
+
+ std::vector<WebIntentServiceData> intents;
+ EXPECT_TRUE(IntentsTable()->GetWebIntentServicesForURL(
+ UTF8ToUTF16(test_url.spec()), &intents));
+ ASSERT_EQ(1U, intents.size());
+ EXPECT_EQ(intent, intents[0]);
+
+ intents.clear();
+ EXPECT_TRUE(IntentsTable()->GetWebIntentServicesForURL(
+ UTF8ToUTF16(test_url_fake.spec()), &intents));
+ EXPECT_EQ(0U, intents.size());
+
+ intent.action = test_action_2;
+ ASSERT_TRUE(IntentsTable()->SetWebIntentService(intent));
+ EXPECT_TRUE(IntentsTable()->GetWebIntentServicesForURL(
+ UTF8ToUTF16(test_url.spec()), &intents));
+ ASSERT_EQ(2U, intents.size());
+}
+
} // namespace
« no previous file with comments | « 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