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

Unified Diff: components/arc/intent_helper/intent_filter_unittest.cc

Issue 2159203003: [arc-intents] Deal correctly with default ports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « components/arc/intent_helper/intent_filter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/intent_helper/intent_filter_unittest.cc
diff --git a/components/arc/intent_helper/intent_filter_unittest.cc b/components/arc/intent_helper/intent_filter_unittest.cc
index f3528cf5decc914987b0027cc0a8ecbabf5c27f8..3a621753b4e469ff2c0d2691c38dae6bb83fb568 100644
--- a/components/arc/intent_helper/intent_filter_unittest.cc
+++ b/components/arc/intent_helper/intent_filter_unittest.cc
@@ -116,6 +116,20 @@ TEST(IntentFilterTest, TestAuthorityEntry_with_port) {
EXPECT_TRUE(filter_port_100.match(GURL("https://authority1:100")));
}
+TEST(IntentFilterTest, TestAuthorityEntry_default_port) {
+ // Intent filters with explicit default ports match URLs with or without
+ // explicit ports. This diverges from android's intent filter behaviour. See
+ // the IntentFilter::AuthorityEntry::match code for details.
+ IntentFilter filter_default_port = IntentFilterBuilder()
+ .authority("authority1", 80)
+ .authority("authority1", 443);
+
+ EXPECT_TRUE(filter_default_port.match(GURL("http://authority1")));
+ EXPECT_TRUE(filter_default_port.match(GURL("https://authority1")));
+ EXPECT_TRUE(filter_default_port.match(GURL("http://authority1:80")));
+ EXPECT_TRUE(filter_default_port.match(GURL("https://authority1:443")));
+}
+
TEST(IntentFilterTest, TestAuthorityEntry_multiple) {
// A filter with multiple authorities should match URLs that match any of
// those authorities.
« no previous file with comments | « components/arc/intent_helper/intent_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698