| 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 "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_constants.h" | 7 #include "ash/shelf/shelf_constants.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // WebContentsObserver overrides. | 41 // WebContentsObserver overrides. |
| 42 virtual void DidFinishLoad( | 42 virtual void DidFinishLoad( |
| 43 int64 frame_id, | 43 int64 frame_id, |
| 44 const GURL& validated_url, | 44 const GURL& validated_url, |
| 45 bool is_main_frame, | 45 bool is_main_frame, |
| 46 content::RenderViewHost* render_view_host) OVERRIDE { | 46 content::RenderViewHost* render_view_host) OVERRIDE { |
| 47 loaded_ = true; | 47 loaded_ = true; |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual void DidUpdateFaviconURL(int32 page_id, | 50 virtual void DidUpdateFaviconURL( |
| 51 const std::vector<content::FaviconURL>& candidates) OVERRIDE { | 51 const std::vector<content::FaviconURL>& candidates) OVERRIDE { |
| 52 if (!candidates.empty()) | 52 if (!candidates.empty()) |
| 53 got_favicons_ = true; | 53 got_favicons_ = true; |
| 54 } | 54 } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 bool loaded_; | 57 bool loaded_; |
| 58 bool got_favicons_; | 58 bool got_favicons_; |
| 59 }; | 59 }; |
| 60 | 60 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 EXPECT_TRUE(favicon_loader_->GetFavicon().empty()); | 180 EXPECT_TRUE(favicon_loader_->GetFavicon().empty()); |
| 181 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); | 181 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); |
| 182 | 182 |
| 183 ASSERT_TRUE(NavigateTo("launcher-largefavicon.html")); | 183 ASSERT_TRUE(NavigateTo("launcher-largefavicon.html")); |
| 184 ASSERT_TRUE(WaitForContentsLoaded()); | 184 ASSERT_TRUE(WaitForContentsLoaded()); |
| 185 EXPECT_TRUE(WaitForFaviconUpdated()); | 185 EXPECT_TRUE(WaitForFaviconUpdated()); |
| 186 | 186 |
| 187 EXPECT_FALSE(favicon_loader_->GetFavicon().empty()); | 187 EXPECT_FALSE(favicon_loader_->GetFavicon().empty()); |
| 188 EXPECT_EQ(128, favicon_loader_->GetFavicon().height()); | 188 EXPECT_EQ(128, favicon_loader_->GetFavicon().height()); |
| 189 } | 189 } |
| OLD | NEW |