• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.eclipse.org/org/documents/epl-v10.php
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.assetstudiolib;
18 
19 import com.android.assetstudiolib.LauncherIconGenerator.LauncherOptions;
20 
21 import java.io.IOException;
22 
23 @SuppressWarnings("javadoc")
24 public class LauncherIconGeneratorTest extends GeneratorTest {
checkGraphic(String baseName, GraphicGenerator.Shape shape, GraphicGenerator.Style style, boolean crop, int background, boolean isWebGraphic)25     private void checkGraphic(String baseName,
26             GraphicGenerator.Shape shape, GraphicGenerator.Style style,
27             boolean crop, int background, boolean isWebGraphic) throws IOException {
28         LauncherOptions options = new LauncherOptions();
29         options.shape = shape;
30         options.crop = crop;
31         options.style = style;
32         options.backgroundColor = background;
33         options.isWebGraphic = isWebGraphic;
34 
35         LauncherIconGenerator generator = new LauncherIconGenerator();
36         checkGraphic(4 + (isWebGraphic ? 1 : 0), "launcher", baseName, generator, options);
37     }
38 
testLauncher_simpleCircle()39     public void testLauncher_simpleCircle() throws Exception {
40         checkGraphic("red_simple_circle", GraphicGenerator.Shape.CIRCLE,
41                 GraphicGenerator.Style.SIMPLE, true, 0xFF0000, true);
42     }
43 
44     // The glossy rendering type is no longer included since it doesn't match the
45     // style guide.
46     //public void testLauncher_glossySquare() throws Exception {
47     //    checkGraphic("blue_glossy_square", GraphicGenerator.Shape.SQUARE,
48     //            GraphicGenerator.Style.GLOSSY, true, 0x0040FF, true);
49     //}
50 }
51