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

Side by Side Diff: chrome/browser/extensions/bookmark_app_helper_unittest.cc

Issue 782693002: Ensure there are always nice icons for bookmark apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review; test Created 6 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/bookmark_app_helper.h" 5 #include "chrome/browser/extensions/bookmark_app_helper.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_service_test_base.h" 9 #include "chrome/browser/extensions/extension_service_test_base.h"
10 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" 10 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 base::RunLoop().RunUntilIdle(); 227 base::RunLoop().RunUntilIdle();
228 EXPECT_TRUE(helper.extension()); 228 EXPECT_TRUE(helper.extension());
229 const Extension* extension = 229 const Extension* extension =
230 service_->GetInstalledExtension(helper.extension()->id()); 230 service_->GetInstalledExtension(helper.extension()->id());
231 EXPECT_TRUE(extension); 231 EXPECT_TRUE(extension);
232 EXPECT_EQ(1u, registry()->enabled_extensions().size()); 232 EXPECT_EQ(1u, registry()->enabled_extensions().size());
233 EXPECT_TRUE(extension->from_bookmark()); 233 EXPECT_TRUE(extension->from_bookmark());
234 EXPECT_EQ(kAppTitle, extension->name()); 234 EXPECT_EQ(kAppTitle, extension->name());
235 EXPECT_EQ(kAppDescription, extension->description()); 235 EXPECT_EQ(kAppDescription, extension->description());
236 EXPECT_EQ(GURL(kAppUrl), AppLaunchInfo::GetLaunchWebURL(extension)); 236 EXPECT_EQ(GURL(kAppUrl), AppLaunchInfo::GetLaunchWebURL(extension));
237 EXPECT_FALSE( 237 // The tiny icon should have been removed and only the generated ones used.
238 EXPECT_TRUE(
238 IconsInfo::GetIconResource( 239 IconsInfo::GetIconResource(
239 extension, kIconSizeTiny, ExtensionIconSet::MATCH_EXACTLY).empty()); 240 extension, kIconSizeTiny, ExtensionIconSet::MATCH_EXACTLY).empty());
240 EXPECT_FALSE( 241 EXPECT_FALSE(
241 IconsInfo::GetIconResource( 242 IconsInfo::GetIconResource(
242 extension, kIconSizeSmall, ExtensionIconSet::MATCH_EXACTLY).empty()); 243 extension, kIconSizeSmall, ExtensionIconSet::MATCH_EXACTLY).empty());
243 EXPECT_FALSE( 244 EXPECT_FALSE(
244 IconsInfo::GetIconResource(extension, 245 IconsInfo::GetIconResource(extension,
245 kIconSizeSmall * 2, 246 kIconSizeSmall * 2,
246 ExtensionIconSet::MATCH_EXACTLY).empty()); 247 ExtensionIconSet::MATCH_EXACTLY).empty());
247 EXPECT_FALSE( 248 EXPECT_FALSE(
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 } 405 }
405 406
406 TEST_F(BookmarkAppHelperTest, IsValidBookmarkAppUrl) { 407 TEST_F(BookmarkAppHelperTest, IsValidBookmarkAppUrl) {
407 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("https://www.chromium.org"))); 408 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("https://www.chromium.org")));
408 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("http://www.chromium.org/path"))); 409 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("http://www.chromium.org/path")));
409 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("ftp://www.chromium.org"))); 410 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("ftp://www.chromium.org")));
410 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("chrome://flags"))); 411 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("chrome://flags")));
411 } 412 }
412 413
413 } // namespace extensions 414 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698