1 package org.robolectric.shadows; 2 3 import android.graphics.SurfaceTexture; 4 import android.view.Surface; 5 import org.robolectric.annotation.Implementation; 6 import org.robolectric.annotation.Implements; 7 import org.robolectric.annotation.RealObject; 8 import org.robolectric.shadow.api.Shadow; 9 import org.robolectric.util.ReflectionHelpers.ClassParameter; 10 11 @Implements(Surface.class) 12 public class ShadowSurface { 13 private SurfaceTexture surfaceTexture; 14 @RealObject private Surface realSurface; 15 16 @Implementation __constructor__(SurfaceTexture surfaceTexture)17 protected void __constructor__(SurfaceTexture surfaceTexture) { 18 this.surfaceTexture = surfaceTexture; 19 Shadow.invokeConstructor( 20 Surface.class, realSurface, ClassParameter.from(SurfaceTexture.class, surfaceTexture)); 21 } 22 getSurfaceTexture()23 public SurfaceTexture getSurfaceTexture() { 24 return surfaceTexture; 25 } 26 } 27