This source file includes following definitions.
- Feature
- testScreenIsOn
package org.chromium.cronet_sample_apk;
import android.content.Context;
import android.os.PowerManager;
import android.test.suitebuilder.annotation.Smoke;
import org.chromium.base.test.util.Feature;
public class CronetSamplePreconditionsTest extends CronetSampleTestBase {
@Smoke
@Feature({"TestInfrastructure"})
public void testScreenIsOn() throws Exception {
PowerManager pm = (PowerManager)getInstrumentation().getContext()
.getSystemService(Context.POWER_SERVICE);
assertTrue("Many tests will fail if the screen is not on.",
pm.isScreenOn());
}
}