| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "components/search_engines/search_host_to_urls_map.h" | 7 #include "components/search_engines/search_host_to_urls_map.h" |
| 8 #include "components/search_engines/search_terms_data.h" | 8 #include "components/search_engines/search_terms_data.h" |
| 9 #include "components/search_engines/template_url.h" | 9 #include "components/search_engines/template_url.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 typedef SearchHostToURLsMap::TemplateURLSet TemplateURLSet; | 12 typedef SearchHostToURLsMap::TemplateURLSet TemplateURLSet; |
| 13 | 13 |
| 14 // Basic functionality for the SearchHostToURLsMap tests. | 14 // Basic functionality for the SearchHostToURLsMap tests. |
| 15 class SearchHostToURLsMapTest : public testing::Test { | 15 class SearchHostToURLsMapTest : public testing::Test { |
| 16 public: | 16 public: |
| 17 SearchHostToURLsMapTest() {} | 17 SearchHostToURLsMapTest() {} |
| 18 | 18 |
| 19 virtual void SetUp(); | 19 void SetUp() override; |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 scoped_ptr<SearchHostToURLsMap> provider_map_; | 22 scoped_ptr<SearchHostToURLsMap> provider_map_; |
| 23 scoped_ptr<TemplateURL> t_urls_[2]; | 23 scoped_ptr<TemplateURL> t_urls_[2]; |
| 24 std::string host_; | 24 std::string host_; |
| 25 | 25 |
| 26 DISALLOW_COPY_AND_ASSIGN(SearchHostToURLsMapTest); | 26 DISALLOW_COPY_AND_ASSIGN(SearchHostToURLsMapTest); |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 void SearchHostToURLsMapTest::SetUp() { | 29 void SearchHostToURLsMapTest::SetUp() { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 for (size_t i = 0; i < arraysize(found_urls); ++i) | 99 for (size_t i = 0; i < arraysize(found_urls); ++i) |
| 100 ASSERT_TRUE(found_urls[i]); | 100 ASSERT_TRUE(found_urls[i]); |
| 101 } | 101 } |
| 102 | 102 |
| 103 TEST_F(SearchHostToURLsMapTest, GetURLsForUnknownHost) { | 103 TEST_F(SearchHostToURLsMapTest, GetURLsForUnknownHost) { |
| 104 const SearchHostToURLsMap::TemplateURLSet* urls = | 104 const SearchHostToURLsMap::TemplateURLSet* urls = |
| 105 provider_map_->GetURLsForHost("a" + host_); | 105 provider_map_->GetURLsForHost("a" + host_); |
| 106 ASSERT_TRUE(urls == NULL); | 106 ASSERT_TRUE(urls == NULL); |
| 107 } | 107 } |
| OLD | NEW |