Chromium Code Reviews| 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..5124d599154e5ab64cec1a21b4207bde2df5e623 100644 |
| --- a/components/arc/intent_helper/local_activity_resolver_unittest.cc |
| +++ b/components/arc/intent_helper/local_activity_resolver_unittest.cc |
| @@ -15,13 +15,10 @@ 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)); |
| +IntentFilter GetIntentFilter(const std::string& host) { |
| + IntentFilter filter; |
| + IntentFilter::AuthorityEntry authority_entry(host, -1); |
| + filter.authorities().emplace_back(std::move(authority_entry)); |
|
Luis Héctor Chávez
2016/11/30 23:05:00
std::vector<IntentFilter::AuthorityEntry> authorit
yoshiki
2016/12/02 19:34:28
Done.
|
| return filter; |
| } |
| @@ -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"))); |