| 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/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 void OnUpdateFaviconURL(int32 page_id, | 55 void OnUpdateFaviconURL(int32 page_id, |
| 56 const std::vector<FaviconURL>& candidates) { | 56 const std::vector<FaviconURL>& candidates) { |
| 57 got_favicons_ = true; | 57 got_favicons_ = true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void OnDidDownloadFavicon(int id, | 60 void OnDidDownloadFavicon(int id, |
| 61 const GURL& image_url, | 61 const GURL& image_url, |
| 62 bool errored, | 62 bool errored, |
| 63 const SkBitmap& bitmap) { | 63 int requested_size, |
| 64 const std::vector<SkBitmap>& bitmaps) { |
| 64 ++downloads_received_; | 65 ++downloads_received_; |
| 65 } | 66 } |
| 66 | 67 |
| 67 bool got_favicons_; | 68 bool got_favicons_; |
| 68 int downloads_received_; | 69 int downloads_received_; |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 } // namespace | 72 } // namespace |
| 72 | 73 |
| 73 class LauncherFaviconLoaderBrowsertest : public InProcessBrowserTest { | 74 class LauncherFaviconLoaderBrowsertest : public InProcessBrowserTest { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 NavigateTo(panel_browser, "launcher-smallfavicon.html"); | 189 NavigateTo(panel_browser, "launcher-smallfavicon.html"); |
| 189 EXPECT_TRUE(WaitForFaviconDownlads(1)); | 190 EXPECT_TRUE(WaitForFaviconDownlads(1)); |
| 190 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); | 191 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); |
| 191 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); | 192 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); |
| 192 | 193 |
| 193 NavigateTo(panel_browser, "launcher-largefavicon.html"); | 194 NavigateTo(panel_browser, "launcher-largefavicon.html"); |
| 194 EXPECT_TRUE(WaitForFaviconDownlads(1)); | 195 EXPECT_TRUE(WaitForFaviconDownlads(1)); |
| 195 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); | 196 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); |
| 196 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); | 197 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); |
| 197 } | 198 } |
| OLD | NEW |