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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" | 9 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
10 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" | 10 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_tabstrip.h" | 12 #include "chrome/browser/ui/browser_tabstrip.h" |
13 #include "chrome/browser/ui/views/frame/browser_view.h" | 13 #include "chrome/browser/ui/views/frame/browser_view.h" |
14 #include "chrome/common/favicon_url.h" | |
15 #include "chrome/common/icon_messages.h" | 14 #include "chrome/common/icon_messages.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
19 #include "content/public/browser/web_contents_delegate.h" | 18 #include "content/public/browser/web_contents_delegate.h" |
20 #include "content/public/browser/web_contents_observer.h" | 19 #include "content/public/browser/web_contents_observer.h" |
| 20 #include "content/public/common/favicon_url.h" |
21 #include "net/test/test_server.h" | 21 #include "net/test/test_server.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 | 23 |
| 24 using content::FaviconURL; |
| 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 // Observer class to determine when favicons have completed loading. | 28 // Observer class to determine when favicons have completed loading. |
27 class ContentsObserver : public content::WebContentsObserver { | 29 class ContentsObserver : public content::WebContentsObserver { |
28 public: | 30 public: |
29 explicit ContentsObserver(content::WebContents* web_contents) | 31 explicit ContentsObserver(content::WebContents* web_contents) |
30 : content::WebContentsObserver(web_contents), | 32 : content::WebContentsObserver(web_contents), |
31 got_favicons_(false) { | 33 got_favicons_(false) { |
32 } | 34 } |
33 | 35 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 NavigateTo("launcher-smallfavicon.html"); | 190 NavigateTo("launcher-smallfavicon.html"); |
189 EXPECT_TRUE(WaitForFaviconDownloads()); | 191 EXPECT_TRUE(WaitForFaviconDownloads()); |
190 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); | 192 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); |
191 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); | 193 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); |
192 | 194 |
193 NavigateTo("launcher-largefavicon.html"); | 195 NavigateTo("launcher-largefavicon.html"); |
194 EXPECT_TRUE(WaitForFaviconDownloads()); | 196 EXPECT_TRUE(WaitForFaviconDownloads()); |
195 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); | 197 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); |
196 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); | 198 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); |
197 } | 199 } |
OLD | NEW |