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

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

Issue 10388036: Adds the option of aligning the launcher to the left or right. There (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 8 years, 7 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
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 <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/views/ash/launcher/browser_launcher_item_controller. h" 10 #include "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller. h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ASSERT_TRUE(test_server()->Start()); 159 ASSERT_TRUE(test_server()->Start());
160 Browser* panel_browser; 160 Browser* panel_browser;
161 ASSERT_NO_FATAL_FAILURE( 161 ASSERT_NO_FATAL_FAILURE(
162 CreatePanelBrowser("launcher-manyfavicon.html", &panel_browser)); 162 CreatePanelBrowser("launcher-manyfavicon.html", &panel_browser));
163 LauncherFaviconLoader* favicon_loader = GetFaviconLoader(panel_browser); 163 LauncherFaviconLoader* favicon_loader = GetFaviconLoader(panel_browser);
164 ASSERT_NE(static_cast<LauncherFaviconLoader*>(NULL), favicon_loader); 164 ASSERT_NE(static_cast<LauncherFaviconLoader*>(NULL), favicon_loader);
165 165
166 EXPECT_TRUE(WaitForFaviconDownlads(3)); 166 EXPECT_TRUE(WaitForFaviconDownlads(3));
167 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); 167 EXPECT_FALSE(favicon_loader->GetFavicon().empty());
168 // When multiple favicons are present, the correctly sized icon should be 168 // When multiple favicons are present, the correctly sized icon should be
169 // chosen. The icons are sized assuming ash::kLauncherPreferredHeight < 128. 169 // chosen. The icons are sized assuming ash::kLauncherPreferredSize < 128.
170 EXPECT_GT(128, ash::kLauncherPreferredHeight); 170 EXPECT_GT(128, ash::kLauncherPreferredSize);
171 EXPECT_EQ(48, favicon_loader->GetFavicon().height()); 171 EXPECT_EQ(48, favicon_loader->GetFavicon().height());
172 } 172 }
173 173
174 IN_PROC_BROWSER_TEST_F(LauncherFaviconLoaderBrowsertest, ChangeLauncherIcons) { 174 IN_PROC_BROWSER_TEST_F(LauncherFaviconLoaderBrowsertest, ChangeLauncherIcons) {
175 ASSERT_TRUE(test_server()->Start()); 175 ASSERT_TRUE(test_server()->Start());
176 Browser* panel_browser; 176 Browser* panel_browser;
177 ASSERT_NO_FATAL_FAILURE( 177 ASSERT_NO_FATAL_FAILURE(
178 CreatePanelBrowser("launcher-manyfavicon.html", &panel_browser)); 178 CreatePanelBrowser("launcher-manyfavicon.html", &panel_browser));
179 LauncherFaviconLoader* favicon_loader = GetFaviconLoader(panel_browser); 179 LauncherFaviconLoader* favicon_loader = GetFaviconLoader(panel_browser);
180 ASSERT_NE(static_cast<LauncherFaviconLoader*>(NULL), favicon_loader); 180 ASSERT_NE(static_cast<LauncherFaviconLoader*>(NULL), favicon_loader);
181 181
182 EXPECT_TRUE(WaitForFaviconDownlads(3)); 182 EXPECT_TRUE(WaitForFaviconDownlads(3));
183 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); 183 EXPECT_FALSE(favicon_loader->GetFavicon().empty());
184 EXPECT_EQ(48, favicon_loader->GetFavicon().height()); 184 EXPECT_EQ(48, favicon_loader->GetFavicon().height());
185 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); 185 ASSERT_NO_FATAL_FAILURE(ResetDownloads());
186 186
187 NavigateTo(panel_browser, "launcher-smallfavicon.html"); 187 NavigateTo(panel_browser, "launcher-smallfavicon.html");
188 EXPECT_TRUE(WaitForFaviconDownlads(1)); 188 EXPECT_TRUE(WaitForFaviconDownlads(1));
189 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); 189 EXPECT_TRUE(favicon_loader->GetFavicon().empty());
190 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); 190 ASSERT_NO_FATAL_FAILURE(ResetDownloads());
191 191
192 NavigateTo(panel_browser, "launcher-largefavicon.html"); 192 NavigateTo(panel_browser, "launcher-largefavicon.html");
193 EXPECT_TRUE(WaitForFaviconDownlads(1)); 193 EXPECT_TRUE(WaitForFaviconDownlads(1));
194 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); 194 EXPECT_FALSE(favicon_loader->GetFavicon().empty());
195 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); 195 EXPECT_EQ(128, favicon_loader->GetFavicon().height());
196 } 196 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/launcher/launcher_favicon_loader.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698