| OLD | NEW |
| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_service_test_base.h" | 10 #include "chrome/browser/extensions/extension_service_test_base.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 : BookmarkAppHelper(service->profile(), web_app_info, contents) {} | 286 : BookmarkAppHelper(service->profile(), web_app_info, contents) {} |
| 287 | 287 |
| 288 ~TestBookmarkAppHelper() override {} | 288 ~TestBookmarkAppHelper() override {} |
| 289 | 289 |
| 290 void CreationComplete(const extensions::Extension* extension, | 290 void CreationComplete(const extensions::Extension* extension, |
| 291 const WebApplicationInfo& web_app_info) { | 291 const WebApplicationInfo& web_app_info) { |
| 292 extension_ = extension; | 292 extension_ = extension; |
| 293 } | 293 } |
| 294 | 294 |
| 295 void CompleteGetManifest(const content::Manifest& manifest) { | 295 void CompleteGetManifest(const content::Manifest& manifest) { |
| 296 BookmarkAppHelper::OnDidGetManifest(manifest); | 296 BookmarkAppHelper::OnDidGetManifest(GURL(), manifest); |
| 297 } | 297 } |
| 298 | 298 |
| 299 void CompleteIconDownload( | 299 void CompleteIconDownload( |
| 300 bool success, | 300 bool success, |
| 301 const std::map<GURL, std::vector<SkBitmap> >& bitmaps) { | 301 const std::map<GURL, std::vector<SkBitmap> >& bitmaps) { |
| 302 BookmarkAppHelper::OnIconsDownloaded(success, bitmaps); | 302 BookmarkAppHelper::OnIconsDownloaded(success, bitmaps); |
| 303 } | 303 } |
| 304 | 304 |
| 305 const Extension* extension() { return extension_; } | 305 const Extension* extension() { return extension_; } |
| 306 | 306 |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 TestIconGeneration(kIconSizeTiny, 0, 3); | 762 TestIconGeneration(kIconSizeTiny, 0, 3); |
| 763 } | 763 } |
| 764 | 764 |
| 765 TEST_F(BookmarkAppHelperTest, IconsResizedWhenOnlyAGigantorOneIsProvided) { | 765 TEST_F(BookmarkAppHelperTest, IconsResizedWhenOnlyAGigantorOneIsProvided) { |
| 766 // When an enormous icon is provided, each desired icon size should be resized | 766 // When an enormous icon is provided, each desired icon size should be resized |
| 767 // from it, and no icons should be generated. | 767 // from it, and no icons should be generated. |
| 768 TestIconGeneration(kIconSizeGigantor, 0, 3); | 768 TestIconGeneration(kIconSizeGigantor, 0, 3); |
| 769 } | 769 } |
| 770 | 770 |
| 771 } // namespace extensions | 771 } // namespace extensions |
| OLD | NEW |