OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/favicon/content/content_favicon_driver.h" | 5 #include "components/favicon/content/content_favicon_driver.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 content::AppCacheService* appcache_service, | 67 content::AppCacheService* appcache_service, |
68 content::ResourceType resource_type, | 68 content::ResourceType resource_type, |
69 ScopedVector<content::ResourceThrottle>* throttles) override { | 69 ScopedVector<content::ResourceThrottle>* throttles) override { |
70 if (request->url() == url_) { | 70 if (request->url() == url_) { |
71 was_requested_ = true; | 71 was_requested_ = true; |
72 if (request->load_flags() & net::LOAD_BYPASS_CACHE) | 72 if (request->load_flags() & net::LOAD_BYPASS_CACHE) |
73 bypassed_cache_ = true; | 73 bypassed_cache_ = true; |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 void DownloadStarting( | |
78 net::URLRequest* request, | |
79 content::ResourceContext* resource_context, | |
80 int child_id, | |
81 int route_id, | |
82 bool is_content_initiated, | |
83 bool must_download, | |
84 ScopedVector<content::ResourceThrottle>* throttles) override {} | |
85 | |
86 private: | 77 private: |
87 GURL url_; | 78 GURL url_; |
88 bool was_requested_; | 79 bool was_requested_; |
89 bool bypassed_cache_; | 80 bool bypassed_cache_; |
90 | 81 |
91 DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcherHostDelegate); | 82 DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcherHostDelegate); |
92 }; | 83 }; |
93 | 84 |
94 // Checks whether the FaviconDriver is waiting for a download to complete or | 85 // Checks whether the FaviconDriver is waiting for a download to complete or |
95 // for data from the FaviconService. | 86 // for data from the FaviconService. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 232 |
242 // A reload ignoring the cache should refetch the favicon from the website. | 233 // A reload ignoring the cache should refetch the favicon from the website. |
243 { | 234 { |
244 PendingTaskWaiter waiter(web_contents(), this); | 235 PendingTaskWaiter waiter(web_contents(), this); |
245 chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE); | 236 chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE); |
246 waiter.Wait(); | 237 waiter.Wait(); |
247 } | 238 } |
248 ASSERT_TRUE(delegate->was_requested()); | 239 ASSERT_TRUE(delegate->was_requested()); |
249 EXPECT_TRUE(delegate->bypassed_cache()); | 240 EXPECT_TRUE(delegate->bypassed_cache()); |
250 } | 241 } |
OLD | NEW |