Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc

Issue 176883022: Shelf Cleanup (- binary files) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 IN_PROC_BROWSER_TEST_F(LauncherFaviconLoaderBrowsertest, ManyLauncherIcons) { 153 IN_PROC_BROWSER_TEST_F(LauncherFaviconLoaderBrowsertest, ManyLauncherIcons) {
154 ASSERT_TRUE(test_server()->Start()); 154 ASSERT_TRUE(test_server()->Start());
155 ASSERT_TRUE(NavigateTo("launcher-manyfavicon.html")); 155 ASSERT_TRUE(NavigateTo("launcher-manyfavicon.html"));
156 EXPECT_TRUE(WaitForContentsLoaded()); 156 EXPECT_TRUE(WaitForContentsLoaded());
157 EXPECT_TRUE(WaitForFaviconUpdated()); 157 EXPECT_TRUE(WaitForFaviconUpdated());
158 158
159 EXPECT_FALSE(favicon_loader_->GetFavicon().empty()); 159 EXPECT_FALSE(favicon_loader_->GetFavicon().empty());
160 // When multiple favicons are present, the correctly sized icon should be 160 // When multiple favicons are present, the correctly sized icon should be
161 // chosen. The icons are sized assuming ash::kShelfPreferredSize < 128. 161 // chosen. The icons are sized assuming ash::kShelfSize < 128.
162 EXPECT_GT(128, ash::kShelfPreferredSize); 162 EXPECT_GT(128, ash::kShelfSize);
163 EXPECT_EQ(48, favicon_loader_->GetFavicon().height()); 163 EXPECT_EQ(48, favicon_loader_->GetFavicon().height());
164 } 164 }
165 165
166 IN_PROC_BROWSER_TEST_F(LauncherFaviconLoaderBrowsertest, ChangeLauncherIcons) { 166 IN_PROC_BROWSER_TEST_F(LauncherFaviconLoaderBrowsertest, ChangeLauncherIcons) {
167 ASSERT_TRUE(test_server()->Start()); 167 ASSERT_TRUE(test_server()->Start());
168 ASSERT_TRUE(NavigateTo("launcher-manyfavicon.html")); 168 ASSERT_TRUE(NavigateTo("launcher-manyfavicon.html"));
169 EXPECT_TRUE(WaitForContentsLoaded()); 169 EXPECT_TRUE(WaitForContentsLoaded());
170 EXPECT_TRUE(WaitForFaviconUpdated()); 170 EXPECT_TRUE(WaitForFaviconUpdated());
171 171
172 EXPECT_FALSE(favicon_loader_->GetFavicon().empty()); 172 EXPECT_FALSE(favicon_loader_->GetFavicon().empty());
173 EXPECT_EQ(48, favicon_loader_->GetFavicon().height()); 173 EXPECT_EQ(48, favicon_loader_->GetFavicon().height());
174 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); 174 ASSERT_NO_FATAL_FAILURE(ResetDownloads());
175 175
176 ASSERT_TRUE(NavigateTo("launcher-smallfavicon.html")); 176 ASSERT_TRUE(NavigateTo("launcher-smallfavicon.html"));
177 ASSERT_TRUE(WaitForContentsLoaded()); 177 ASSERT_TRUE(WaitForContentsLoaded());
178 EXPECT_TRUE(WaitForFaviconUpdated()); 178 EXPECT_TRUE(WaitForFaviconUpdated());
179 179
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698