1/* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 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 17package com.android.layoutlib.bridge.intensive; 18 19import com.android.ide.common.rendering.api.SessionParams; 20import com.android.layoutlib.bridge.intensive.setup.ConfigGenerator; 21import com.android.layoutlib.bridge.intensive.util.perf.PerformanceRunner; 22 23import org.junit.Before; 24import org.junit.Test; 25import org.junit.runner.RunWith; 26 27import android.annotation.NonNull; 28 29/** 30 * Set of render tests 31 */ 32@RunWith(PerformanceRunner.class) 33public class PerformanceTests extends RenderTestBase { 34 35 @Before 36 public void setUp() { 37 ignoreAllLogging(); 38 } 39 40 41 private void render(@NonNull String layoutFileName) throws ClassNotFoundException { 42 SessionParams params = createSessionParams(layoutFileName, ConfigGenerator.NEXUS_5); 43 render(params, 250); 44 } 45 46 @Test 47 public void testActivity() throws ClassNotFoundException { 48 render("activity.xml"); 49 } 50 51 @Test 52 public void testAllWidgets() throws ClassNotFoundException { 53 render("allwidgets.xml"); 54 } 55} 56