本文整理汇总了Java中android.support.test.filters.SmallTest类的典型用法代码示例。如果您正苦于以下问题:Java SmallTest类的具体用法?Java SmallTest怎么用?Java SmallTest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SmallTest类属于android.support.test.filters包,在下文中一共展示了SmallTest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInitializeUsingByteBufferReInitilizeUsingTextures
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testInitializeUsingByteBufferReInitilizeUsingTextures() {
if (!MediaCodecVideoEncoder.isVp8HwSupportedUsingTextures()) {
Log.i(TAG, "hardware does not support VP8 encoding, skipping testEncoderUsingTextures");
return;
}
MediaCodecVideoEncoder encoder = new MediaCodecVideoEncoder();
assertTrue(encoder.initEncode(
MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480, 300, 30, null));
encoder.release();
EglBase14 eglBase = new EglBase14(null, EglBase.CONFIG_PLAIN);
assertTrue(encoder.initEncode(MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480,
300, 30, eglBase.getEglBaseContext()));
encoder.release();
eglBase.release();
}
示例2: testLayoutMatrixScale
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testLayoutMatrixScale() {
// Video has aspect ratio 2, but layout is square. This will cause only the center part of the
// video to be visible, i.e. the u coordinate will go from 0.25 to 0.75 instead of from 0 to 1.
final float layoutMatrix[] = getLayoutMatrix(false, 2.0f, 1.0f);
// Assert:
// u' = 0.25 + 0.5 u.
// v' = v.
// clang-format off
assertArrayEquals(new double[] {
0.5, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0.25, 0, 0, 1}, round(layoutMatrix), 0.0);
// clang-format on
}
示例3: testEntertainment
import android.support.test.filters.SmallTest; //导入依赖的package包/类
/**
* Test of constructor Entertainment method, of class Entertainment.
*/
@Test
@SmallTest
public void testEntertainment() {
System.out.println("constructorEntertainment");
Entertainment instance = new Entertainment(null,null,null,null,null,null,null,null,null,null);
assertEquals(instance.getName(), null);
assertEquals(instance.getAddress(), null);
assertEquals(instance.getDescription(), null);
assertEquals(instance.getLongitude(), null);
assertEquals(instance.getLatitude(), null);
assertEquals(instance.getPhotoUrl(), null);
assertEquals(instance.getUID(), null);
assertEquals(instance.getAuthor(), null);
assertEquals(instance.getEstablishmentCategory(), null);
}
示例4: testSetLocalOfferMakesVideoFlowLocally
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testSetLocalOfferMakesVideoFlowLocally() throws InterruptedException {
Log.d(TAG, "testSetLocalOfferMakesVideoFlowLocally");
MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_RENDERER_NAME);
pcClient = createPeerConnectionClient(localRenderer, new MockRenderer(0, null),
createParametersForVideoCall(VIDEO_CODEC_VP8),
createCameraCapturer(false /* captureToTexture */), null);
// Wait for local SDP and ice candidates set events.
assertTrue("Local SDP was not set.", waitForLocalSDP(WAIT_TIMEOUT));
assertTrue("ICE candidates were not generated.", waitForIceCandidates(WAIT_TIMEOUT));
// Check that local video frames were rendered.
assertTrue(
"Local video frames were not rendered.", localRenderer.waitForFramesRendered(WAIT_TIMEOUT));
pcClient.close();
assertTrue(
"PeerConnection close event was not received.", waitForPeerConnectionClosed(WAIT_TIMEOUT));
Log.d(TAG, "testSetLocalOfferMakesVideoFlowLocally Done.");
}
示例5: testRgbRendering
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testRgbRendering() {
// Create EGL base with a pixel buffer as display output.
final EglBase eglBase = EglBase.create(null, EglBase.CONFIG_PIXEL_BUFFER);
eglBase.createPbufferSurface(WIDTH, HEIGHT);
eglBase.makeCurrent();
// Create RGB byte buffer plane with random content.
final ByteBuffer rgbPlane = ByteBuffer.allocateDirect(WIDTH * HEIGHT * 3);
final Random random = new Random(SEED);
random.nextBytes(rgbPlane.array());
// Upload the RGB byte buffer data as a texture.
final int rgbTexture = GlUtil.generateTexture(GLES20.GL_TEXTURE_2D);
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, rgbTexture);
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGB, WIDTH, HEIGHT, 0, GLES20.GL_RGB,
GLES20.GL_UNSIGNED_BYTE, rgbPlane);
GlUtil.checkNoGLES2Error("glTexImage2D");
// Draw the RGB frame onto the pixel buffer.
final GlRectDrawer drawer = new GlRectDrawer();
drawer.drawRgb(rgbTexture, RendererCommon.identityMatrix(), WIDTH, HEIGHT, 0 /* viewportX */,
0 /* viewportY */, WIDTH, HEIGHT);
// Download the pixels in the pixel buffer as RGBA. Not all platforms support RGB, e.g. Nexus 9.
final ByteBuffer rgbaData = ByteBuffer.allocateDirect(WIDTH * HEIGHT * 4);
GLES20.glReadPixels(0, 0, WIDTH, HEIGHT, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, rgbaData);
GlUtil.checkNoGLES2Error("glReadPixels");
// Assert rendered image is pixel perfect to source RGB.
assertByteBufferEquals(WIDTH, HEIGHT, stripAlphaChannel(rgbaData), rgbPlane);
drawer.release();
GLES20.glDeleteTextures(1, new int[] {rgbTexture}, 0);
eglBase.release();
}
示例6: testLoopbackVp8CaptureToTexture
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testLoopbackVp8CaptureToTexture() throws InterruptedException {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
Log.i(TAG, "Encode to textures is not supported. Requires SDK version 19");
return;
}
// TODO(perkj): If we can always capture to textures, there is no need to check if the
// hardware encoder supports to encode from a texture.
if (!MediaCodecVideoEncoder.isVp8HwSupportedUsingTextures()) {
Log.i(TAG, "VP8 encode to textures is not supported.");
return;
}
doLoopbackTest(createParametersForVideoCall(VIDEO_CODEC_VP8),
createCameraCapturer(true /* captureToTexture */), true /* decodeToTexture */);
}
示例7: testLoopbackH264CaptureToTexture
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testLoopbackH264CaptureToTexture() throws InterruptedException {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
Log.i(TAG, "Encode to textures is not supported. Requires KITKAT");
return;
}
// TODO(perkj): If we can always capture to textures, there is no need to check if the
// hardware encoder supports to encode from a texture.
if (!MediaCodecVideoEncoder.isH264HwSupportedUsingTextures()) {
Log.i(TAG, "H264 encode to textures is not supported.");
return;
}
doLoopbackTest(createParametersForVideoCall(VIDEO_CODEC_H264),
createCameraCapturer(true /* captureToTexture */), true /* decodeToTexture */);
}
示例8: testConnectivityManagerDelegateDoesNotCrash
import android.support.test.filters.SmallTest; //导入依赖的package包/类
/**
* Tests that ConnectivityManagerDelegate doesn't crash. This test cannot rely on having any
* active network connections so it cannot usefully check results, but it can at least check
* that the functions don't crash.
*/
@Test
@UiThreadTest
@SmallTest
public void testConnectivityManagerDelegateDoesNotCrash() {
ConnectivityManagerDelegate delegate =
new ConnectivityManagerDelegate(InstrumentationRegistry.getTargetContext());
delegate.getNetworkState();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Network[] networks = delegate.getAllNetworks();
if (networks.length >= 1) {
delegate.getNetworkState(networks[0]);
delegate.hasInternetCapability(networks[0]);
}
delegate.getDefaultNetId();
}
}
示例9: testSentence
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testSentence() {
System.out.println("constructorSentence");
Sentence instance = new Sentence(0,"This is a test sentence.",0, 0);
assertEquals(instance.noOfWords, 5);
assertEquals(instance.stringLength, 0);
assertEquals(instance.score, 0.0);
assertEquals(instance.number, 0);
assertEquals(instance.value, "This is a test sentence.");
assertEquals(instance.paragraphNumber, 0);
}
示例10: testSetStringLength
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testSetStringLength() {
System.out.println("setStringLength");
int length = 1;
Sentence instance = new Sentence();
instance.setStringLength(length);
assertEquals(instance.getStringLength(), length);
}
示例11: testGetStringLength
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testGetStringLength() {
System.out.println("getStringLength");
Sentence instance = new Sentence();
int expResult = 1;
instance.setStringLength(1);
int result = instance.getStringLength();
assertEquals(expResult, result);
}
示例12: testSetParagraphNumber
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testSetParagraphNumber() {
System.out.println("setParagraphNumber");
int number = 1;
Sentence instance = new Sentence();
instance.setParagraphNumber(number);
assertEquals(instance.getParagraphNumber(), number);
}
示例13: testGetPargraphNumber
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testGetPargraphNumber() {
System.out.println("getParagraphNumber");
Sentence instance = new Sentence();
int expResult = 1;
instance.setParagraphNumber(1);
int result = instance.getParagraphNumber();
assertEquals(expResult, result);
}
示例14: testInitilizeUsingTextures
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testInitilizeUsingTextures() {
if (!MediaCodecVideoEncoder.isVp8HwSupportedUsingTextures()) {
Log.i(TAG, "hardware does not support VP8 encoding, skipping testEncoderUsingTextures");
return;
}
EglBase14 eglBase = new EglBase14(null, EglBase.CONFIG_PLAIN);
MediaCodecVideoEncoder encoder = new MediaCodecVideoEncoder();
assertTrue(encoder.initEncode(MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480,
300, 30, eglBase.getEglBaseContext()));
encoder.release();
eglBase.release();
}
示例15: testGetNumber
import android.support.test.filters.SmallTest; //导入依赖的package包/类
@Test
@SmallTest
public void testGetNumber() {
System.out.println("getNumber");
Sentence instance = new Sentence();
int expResult = 1;
instance.setNumber(1);
int result = instance.getNumber();
assertEquals(expResult, result);
}