OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/callback_helpers.h" | 5 #include "base/callback_helpers.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/search_engines/template_url_fetcher.h" | |
12 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" | 11 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" |
13 #include "chrome/browser/search_engines/template_url_service_test_util.h" | 12 #include "chrome/browser/search_engines/template_url_service_test_util.h" |
14 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
16 #include "components/search_engines/template_url.h" | 15 #include "components/search_engines/template_url.h" |
| 16 #include "components/search_engines/template_url_fetcher.h" |
17 #include "components/search_engines/template_url_service.h" | 17 #include "components/search_engines/template_url_service.h" |
18 #include "net/test/embedded_test_server/embedded_test_server.h" | 18 #include "net/test/embedded_test_server/embedded_test_server.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 | 21 |
22 using base::ASCIIToUTF16; | 22 using base::ASCIIToUTF16; |
23 | 23 |
24 // Basic set-up for TemplateURLFetcher tests. | 24 // Basic set-up for TemplateURLFetcher tests. |
25 class TemplateURLFetcherTest : public testing::Test { | 25 class TemplateURLFetcherTest : public testing::Test { |
26 public: | 26 public: |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 StartDownload(keyword, osdd_file_name, | 302 StartDownload(keyword, osdd_file_name, |
303 TemplateURLFetcher::EXPLICIT_PROVIDER, true); | 303 TemplateURLFetcher::EXPLICIT_PROVIDER, true); |
304 ASSERT_EQ(0, add_provider_called_); | 304 ASSERT_EQ(0, add_provider_called_); |
305 ASSERT_EQ(1, callbacks_destroyed_); | 305 ASSERT_EQ(1, callbacks_destroyed_); |
306 | 306 |
307 WaitForDownloadToFinish(); | 307 WaitForDownloadToFinish(); |
308 ASSERT_EQ(1, add_provider_called_); | 308 ASSERT_EQ(1, add_provider_called_); |
309 ASSERT_EQ(2, callbacks_destroyed_); | 309 ASSERT_EQ(2, callbacks_destroyed_); |
310 ASSERT_TRUE(last_callback_template_url_.get()); | 310 ASSERT_TRUE(last_callback_template_url_.get()); |
311 } | 311 } |
OLD | NEW |