FileDocCategorySizeDatePackage
InflateTest.javaAPI DocAndroid 5.1 API4269Thu Mar 12 22:22:12 GMT 2015android.view

InflateTest

public class InflateTest extends android.test.AndroidTestCase implements android.test.PerformanceTestCase

Fields Summary
private android.view.LayoutInflater
mInflater
private android.content.res.Resources
mResources
private android.view.View
mView
Constructors Summary
Methods Summary
public voidinflateCachedTest(int resourceId)

        // Make sure this layout is in the cache.
        mInflater.inflate(resourceId, null);

        mInflater.inflate(resourceId, null);
    
public voidinflateTest(int resourceId)

        mView = mInflater.inflate(resourceId, null);
        mResources.flushLayoutCache();
    
public booleanisPerformanceOnly()

        return false;
    
protected voidsetUp()

        super.setUp();

        mInflater = LayoutInflater.from(mContext);
        mResources = mContext.getResources();

        // to try to make things consistent, before doing timing
        // do an initial instantiation of the layout and then clear
        // out the layout cache.
//            mInflater.inflate(mResId, null, null);
//            mResources.flushLayoutCache();
    
public intstartPerformance(PerformanceTestCase.Intermediates intermediates)

        return 0;
    
public voidtestCachedLayout1()

        inflateCachedTest(R.layout.layout_one);
    
public voidtestCachedLayout2()

        inflateCachedTest(R.layout.layout_two);
    
public voidtestCachedLayout3()

        inflateCachedTest(R.layout.layout_three);
    
public voidtestCachedLayout4()

        inflateCachedTest(R.layout.layout_four);
    
public voidtestCachedLayout5()

        inflateCachedTest(R.layout.layout_five);
    
public voidtestCachedLayout6()

        inflateCachedTest(R.layout.layout_six);
    
public voidtestLayout1()

        inflateTest(R.layout.layout_one);
    
public voidtestLayout2()

        inflateTest(R.layout.layout_two);
    
public voidtestLayout3()

        inflateTest(R.layout.layout_three);
    
public voidtestLayout4()

        inflateTest(R.layout.layout_four);
    
public voidtestLayout5()

        inflateTest(R.layout.layout_five);
    
public voidtestLayout6()

        inflateTest(R.layout.layout_six);