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/launcher/launcher_types.h" | 7 #include "ash/launcher/launcher_types.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 class LauncherFaviconLoaderBrowsertest | 62 class LauncherFaviconLoaderBrowsertest |
63 : public InProcessBrowserTest, | 63 : public InProcessBrowserTest, |
64 public LauncherFaviconLoader::Delegate { | 64 public LauncherFaviconLoader::Delegate { |
65 public: | 65 public: |
66 LauncherFaviconLoaderBrowsertest() : favicon_updated_(false) { | 66 LauncherFaviconLoaderBrowsertest() : favicon_updated_(false) { |
67 } | 67 } |
68 | 68 |
69 virtual ~LauncherFaviconLoaderBrowsertest() { | 69 virtual ~LauncherFaviconLoaderBrowsertest() { |
70 } | 70 } |
71 | 71 |
72 virtual void SetUpOnMainThread() { | 72 virtual void SetUpOnMainThread() OVERRIDE { |
73 WebContents* web_contents = | 73 WebContents* web_contents = |
74 browser()->tab_strip_model()->GetActiveWebContents(); | 74 browser()->tab_strip_model()->GetActiveWebContents(); |
75 contents_observer_.reset(new ContentsObserver(web_contents)); | 75 contents_observer_.reset(new ContentsObserver(web_contents)); |
76 favicon_loader_.reset(new LauncherFaviconLoader(this, web_contents)); | 76 favicon_loader_.reset(new LauncherFaviconLoader(this, web_contents)); |
77 } | 77 } |
78 | 78 |
79 // LauncherFaviconLoader::Delegate overrides: | 79 // LauncherFaviconLoader::Delegate overrides: |
80 virtual void FaviconUpdated() OVERRIDE { | 80 virtual void FaviconUpdated() OVERRIDE { |
81 favicon_updated_ = true; | 81 favicon_updated_ = true; |
82 } | 82 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 EXPECT_TRUE(favicon_loader_->GetFavicon().empty()); | 179 EXPECT_TRUE(favicon_loader_->GetFavicon().empty()); |
180 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); | 180 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); |
181 | 181 |
182 ASSERT_TRUE(NavigateTo("launcher-largefavicon.html")); | 182 ASSERT_TRUE(NavigateTo("launcher-largefavicon.html")); |
183 ASSERT_TRUE(WaitForContentsLoaded()); | 183 ASSERT_TRUE(WaitForContentsLoaded()); |
184 EXPECT_TRUE(WaitForFaviconUpdated()); | 184 EXPECT_TRUE(WaitForFaviconUpdated()); |
185 | 185 |
186 EXPECT_FALSE(favicon_loader_->GetFavicon().empty()); | 186 EXPECT_FALSE(favicon_loader_->GetFavicon().empty()); |
187 EXPECT_EQ(128, favicon_loader_->GetFavicon().height()); | 187 EXPECT_EQ(128, favicon_loader_->GetFavicon().height()); |
188 } | 188 } |
OLD | NEW |