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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_icon_unittest.cc

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: Created 7 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
6
7 #include "chrome/common/extensions/extension.h"
8 #include "chrome/common/extensions/extension_constants.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 TEST_F(ExtensionManifestTest, NormalizeIconPaths) {
12 scoped_refptr<extensions::Extension> extension(
13 LoadAndExpectSuccess("normalize_icon_paths.json"));
14 EXPECT_EQ("16.png", extension->icons().Get(
15 extension_misc::EXTENSION_ICON_BITTY, ExtensionIconSet::MATCH_EXACTLY));
16 EXPECT_EQ("48.png", extension->icons().Get(
17 extension_misc::EXTENSION_ICON_MEDIUM,
18 ExtensionIconSet::MATCH_EXACTLY));
19 }
20
21 TEST_F(ExtensionManifestTest, InvalidIconSizes) {
22 scoped_refptr<extensions::Extension> extension(
23 LoadAndExpectSuccess("init_ignored_icon_size.json"));
24 EXPECT_EQ("",
25 extension->icons().Get(300, ExtensionIconSet::MATCH_EXACTLY));
26 }
27
28 TEST_F(ExtensionManifestTest, ValidIconSizes) {
29 scoped_refptr<extensions::Extension> extension(
30 LoadAndExpectSuccess("init_valid_icon_size.json"));
31 EXPECT_EQ("16.png", extension->icons().Get(
32 extension_misc::EXTENSION_ICON_BITTY, ExtensionIconSet::MATCH_EXACTLY));
33 EXPECT_EQ("24.png", extension->icons().Get(
34 extension_misc::EXTENSION_ICON_SMALLISH,
35 ExtensionIconSet::MATCH_EXACTLY));
36 EXPECT_EQ("32.png", extension->icons().Get(
37 extension_misc::EXTENSION_ICON_SMALL, ExtensionIconSet::MATCH_EXACTLY));
38 EXPECT_EQ("48.png", extension->icons().Get(
39 extension_misc::EXTENSION_ICON_MEDIUM,
40 ExtensionIconSet::MATCH_EXACTLY));
41 EXPECT_EQ("128.png", extension->icons().Get(
42 extension_misc::EXTENSION_ICON_LARGE, ExtensionIconSet::MATCH_EXACTLY));
43 EXPECT_EQ("256.png", extension->icons().Get(
44 extension_misc::EXTENSION_ICON_EXTRA_LARGE,
45 ExtensionIconSet::MATCH_EXACTLY));
46 EXPECT_EQ("512.png", extension->icons().Get(
47 extension_misc::EXTENSION_ICON_GIGANTOR,
48 ExtensionIconSet::MATCH_EXACTLY));
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698