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

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

Issue 2557703002: Revert of Use mojo typemaps to simplify arc::IntentFilter::IntentFilter() (Closed)
Patch Set: Created 4 years 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/local_activity_resolver.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/local_activity_resolver_unittest.cc
diff --git a/components/arc/intent_helper/local_activity_resolver_unittest.cc b/components/arc/intent_helper/local_activity_resolver_unittest.cc
index c742af50c52a11909ec6be487656a05c77986942..fff6076e4e868e2aaa5a0fb0b06b5a0b361ce17d 100644
--- a/components/arc/intent_helper/local_activity_resolver_unittest.cc
+++ b/components/arc/intent_helper/local_activity_resolver_unittest.cc
@@ -15,11 +15,14 @@
namespace {
-IntentFilter GetIntentFilter(const std::string& host) {
- std::vector<IntentFilter::AuthorityEntry> authorities;
- authorities.emplace_back(host, -1);
-
- return IntentFilter(std::move(authorities), {});
+mojom::IntentFilterPtr GetIntentFilter(const std::string& host) {
+ mojom::IntentFilterPtr filter = mojom::IntentFilter::New();
+ mojom::AuthorityEntryPtr authority_entry = mojom::AuthorityEntry::New();
+ authority_entry->host = host;
+ authority_entry->port = -1;
+ filter->data_authorities = std::vector<mojom::AuthorityEntryPtr>();
+ filter->data_authorities->push_back(std::move(authority_entry));
+ return filter;
}
} // namespace
@@ -38,8 +41,8 @@
TEST(LocalActivityResolverTest, TestSingleFilter) {
scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
- std::vector<IntentFilter> array;
- array.emplace_back(GetIntentFilter("www.google.com"));
+ std::vector<mojom::IntentFilterPtr> array;
+ array.push_back(GetIntentFilter("www.google.com"));
resolver->UpdateIntentFilters(std::move(array));
EXPECT_FALSE(resolver->ShouldChromeHandleUrl(GURL("http://www.google.com")));
@@ -53,10 +56,10 @@
TEST(LocalActivityResolverTest, TestMultipleFilters) {
scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
- std::vector<IntentFilter> array;
- array.emplace_back(GetIntentFilter("www.google.com"));
- array.emplace_back(GetIntentFilter("www.google.co.uk"));
- array.emplace_back(GetIntentFilter("dev.chromium.org"));
+ std::vector<mojom::IntentFilterPtr> array;
+ array.push_back(GetIntentFilter("www.google.com"));
+ array.push_back(GetIntentFilter("www.google.co.uk"));
+ array.push_back(GetIntentFilter("dev.chromium.org"));
resolver->UpdateIntentFilters(std::move(array));
EXPECT_FALSE(resolver->ShouldChromeHandleUrl(GURL("http://www.google.com")));
@@ -77,8 +80,8 @@
TEST(LocalActivityResolverTest, TestNonHttp) {
scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
- std::vector<IntentFilter> array;
- array.emplace_back(GetIntentFilter("www.google.com"));
+ std::vector<mojom::IntentFilterPtr> array;
+ array.push_back(GetIntentFilter("www.google.com"));
resolver->UpdateIntentFilters(std::move(array));
EXPECT_TRUE(resolver->ShouldChromeHandleUrl(GURL("chrome://www.google.com")));
@@ -90,15 +93,15 @@
TEST(LocalActivityResolverTest, TestMultipleUpdate) {
scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
- std::vector<IntentFilter> array;
- array.emplace_back(GetIntentFilter("www.google.com"));
- array.emplace_back(GetIntentFilter("dev.chromium.org"));
+ std::vector<mojom::IntentFilterPtr> array;
+ array.push_back(GetIntentFilter("www.google.com"));
+ array.push_back(GetIntentFilter("dev.chromium.org"));
resolver->UpdateIntentFilters(std::move(array));
- std::vector<IntentFilter> array2;
- array2.emplace_back(GetIntentFilter("www.google.co.uk"));
- array2.emplace_back(GetIntentFilter("dev.chromium.org"));
- array2.emplace_back(GetIntentFilter("www.android.com"));
+ std::vector<mojom::IntentFilterPtr> array2;
+ array2.push_back(GetIntentFilter("www.google.co.uk"));
+ array2.push_back(GetIntentFilter("dev.chromium.org"));
+ array2.push_back(GetIntentFilter("www.android.com"));
resolver->UpdateIntentFilters(std::move(array2));
EXPECT_TRUE(resolver->ShouldChromeHandleUrl(GURL("http://www.google.com")));
« no previous file with comments | « components/arc/intent_helper/local_activity_resolver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698