| 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 fff6076e4e868e2aaa5a0fb0b06b5a0b361ce17d..c742af50c52a11909ec6be487656a05c77986942 100644
|
| --- a/components/arc/intent_helper/local_activity_resolver_unittest.cc
|
| +++ b/components/arc/intent_helper/local_activity_resolver_unittest.cc
|
| @@ -15,14 +15,11 @@ namespace arc {
|
|
|
| namespace {
|
|
|
| -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;
|
| +IntentFilter GetIntentFilter(const std::string& host) {
|
| + std::vector<IntentFilter::AuthorityEntry> authorities;
|
| + authorities.emplace_back(host, -1);
|
| +
|
| + return IntentFilter(std::move(authorities), {});
|
| }
|
|
|
| } // namespace
|
| @@ -41,8 +38,8 @@ TEST(LocalActivityResolverTest, TestDefault) {
|
| TEST(LocalActivityResolverTest, TestSingleFilter) {
|
| scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
|
|
|
| - std::vector<mojom::IntentFilterPtr> array;
|
| - array.push_back(GetIntentFilter("www.google.com"));
|
| + std::vector<IntentFilter> array;
|
| + array.emplace_back(GetIntentFilter("www.google.com"));
|
| resolver->UpdateIntentFilters(std::move(array));
|
|
|
| EXPECT_FALSE(resolver->ShouldChromeHandleUrl(GURL("http://www.google.com")));
|
| @@ -56,10 +53,10 @@ TEST(LocalActivityResolverTest, TestSingleFilter) {
|
| TEST(LocalActivityResolverTest, TestMultipleFilters) {
|
| scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
|
|
|
| - 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"));
|
| + 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"));
|
| resolver->UpdateIntentFilters(std::move(array));
|
|
|
| EXPECT_FALSE(resolver->ShouldChromeHandleUrl(GURL("http://www.google.com")));
|
| @@ -80,8 +77,8 @@ TEST(LocalActivityResolverTest, TestMultipleFilters) {
|
| TEST(LocalActivityResolverTest, TestNonHttp) {
|
| scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
|
|
|
| - std::vector<mojom::IntentFilterPtr> array;
|
| - array.push_back(GetIntentFilter("www.google.com"));
|
| + std::vector<IntentFilter> array;
|
| + array.emplace_back(GetIntentFilter("www.google.com"));
|
| resolver->UpdateIntentFilters(std::move(array));
|
|
|
| EXPECT_TRUE(resolver->ShouldChromeHandleUrl(GURL("chrome://www.google.com")));
|
| @@ -93,15 +90,15 @@ TEST(LocalActivityResolverTest, TestNonHttp) {
|
| TEST(LocalActivityResolverTest, TestMultipleUpdate) {
|
| scoped_refptr<LocalActivityResolver> resolver(new LocalActivityResolver());
|
|
|
| - std::vector<mojom::IntentFilterPtr> array;
|
| - array.push_back(GetIntentFilter("www.google.com"));
|
| - array.push_back(GetIntentFilter("dev.chromium.org"));
|
| + std::vector<IntentFilter> array;
|
| + array.emplace_back(GetIntentFilter("www.google.com"));
|
| + array.emplace_back(GetIntentFilter("dev.chromium.org"));
|
| resolver->UpdateIntentFilters(std::move(array));
|
|
|
| - 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"));
|
| + 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"));
|
| resolver->UpdateIntentFilters(std::move(array2));
|
|
|
| EXPECT_TRUE(resolver->ShouldChromeHandleUrl(GURL("http://www.google.com")));
|
|
|