Uncomment VisibleForTesting annotations

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220432564
This commit is contained in:
eguven 2018-11-07 02:29:53 -08:00 committed by Oliver Woodman
parent d7e23f826b
commit 7a114cb374
8 changed files with 37 additions and 31 deletions

View file

@ -21,6 +21,7 @@ import android.os.Looper;
import android.os.SystemClock;
import android.support.annotation.IntDef;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.view.ViewGroup;
import com.google.ads.interactivemedia.v3.api.Ad;
import com.google.ads.interactivemedia.v3.api.AdDisplayContainer;
@ -206,7 +207,7 @@ public final class ImaAdsLoader
return this;
}
// @VisibleForTesting
@VisibleForTesting
/* package */ Builder setImaFactory(ImaFactory imaFactory) {
this.imaFactory = Assertions.checkNotNull(imaFactory);
return this;
@ -1346,7 +1347,7 @@ public final class ImaAdsLoader
}
/** Factory for objects provided by the IMA SDK. */
// @VisibleForTesting
@VisibleForTesting
/* package */ interface ImaFactory {
/** @see ImaSdkSettings */
ImaSdkSettings createImaSdkSettings();

View file

@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.extractor.ogg;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.ExtractorInput;
import com.google.android.exoplayer2.extractor.SeekMap;
@ -26,10 +27,8 @@ import java.io.IOException;
/** Seeks in an Ogg stream. */
/* package */ final class DefaultOggSeeker implements OggSeeker {
//@VisibleForTesting
public static final int MATCH_RANGE = 72000;
//@VisibleForTesting
public static final int MATCH_BYTE_RANGE = 100000;
@VisibleForTesting public static final int MATCH_RANGE = 72000;
@VisibleForTesting public static final int MATCH_BYTE_RANGE = 100000;
private static final int DEFAULT_OFFSET = 30000;
private static final int STATE_SEEK_TO_END = 0;
@ -133,7 +132,7 @@ import java.io.IOException;
return totalGranules != 0 ? new OggSeekMap() : null;
}
//@VisibleForTesting
@VisibleForTesting
public void resetSeeking() {
start = startPosition;
end = endPosition;
@ -150,12 +149,12 @@ import java.io.IOException;
*
* @param targetGranule the target granule position to seek to.
* @param input the {@link ExtractorInput} to read from.
* @return the position to seek the {@link ExtractorInput} to for a next call or
* -(currentGranule + 2) if it's close enough to skip to the target page.
* @return the position to seek the {@link ExtractorInput} to for a next call or -(currentGranule
* + 2) if it's close enough to skip to the target page.
* @throws IOException thrown if reading from the input fails.
* @throws InterruptedException thrown if interrupted while reading from the input.
*/
//@VisibleForTesting
@VisibleForTesting
public long getNextSeekPosition(long targetGranule, ExtractorInput input)
throws IOException, InterruptedException {
if (start == end) {
@ -250,7 +249,7 @@ import java.io.IOException;
* @throws InterruptedException If the thread is interrupted.
* @throws EOFException If the next page can't be found before the end of the input.
*/
// @VisibleForTesting
@VisibleForTesting
void skipToNextPage(ExtractorInput input) throws IOException, InterruptedException {
if (!skipToNextPage(input, endPosition)) {
// Not found until eof.
@ -267,7 +266,7 @@ import java.io.IOException;
* @throws IOException thrown if peeking/reading from the input fails.
* @throws InterruptedException thrown if interrupted while peeking/reading from the input.
*/
// @VisibleForTesting
@VisibleForTesting
boolean skipToNextPage(ExtractorInput input, long limit)
throws IOException, InterruptedException {
limit = Math.min(limit + 3, endPosition);
@ -307,7 +306,7 @@ import java.io.IOException;
* @throws IOException If reading from the input fails.
* @throws InterruptedException If the thread is interrupted.
*/
// @VisibleForTesting
@VisibleForTesting
long readGranuleOfLastPage(ExtractorInput input) throws IOException, InterruptedException {
skipToNextPage(input);
pageHeader.reset();
@ -319,8 +318,8 @@ import java.io.IOException;
}
/**
* Skips to the position of the start of the page containing the {@code targetGranule} and
* returns the granule of the page previous to the target page.
* Skips to the position of the start of the page containing the {@code targetGranule} and returns
* the granule of the page previous to the target page.
*
* @param input the {@link ExtractorInput} to read from.
* @param targetGranule the target granule.
@ -331,7 +330,7 @@ import java.io.IOException;
* @throws IOException thrown if reading from the input fails.
* @throws InterruptedException thrown if interrupted while reading from the input.
*/
//@VisibleForTesting
@VisibleForTesting
long skipToPageOfGranule(ExtractorInput input, long targetGranule, long currentGranule)
throws IOException, InterruptedException {
pageHeader.populate(input, false);

View file

@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.extractor.ogg;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.extractor.ExtractorInput;
import com.google.android.exoplayer2.util.Assertions;
@ -103,14 +104,14 @@ import java.util.Arrays;
/**
* An OGG Packet may span multiple pages. Returns the {@link OggPageHeader} of the last page read,
* or an empty header if the packet has yet to be populated.
* <p>
* Note that the returned {@link OggPageHeader} is mutable and may be updated during subsequent
*
* <p>Note that the returned {@link OggPageHeader} is mutable and may be updated during subsequent
* calls to {@link #populate(ExtractorInput)}.
*
* @return the {@code PageHeader} of the last page read or an empty header if the packet has yet
* to be populated.
*/
//@VisibleForTesting
@VisibleForTesting
public OggPageHeader getPageHeader() {
return pageHeader;
}

View file

@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.extractor.ogg;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.ogg.VorbisUtil.Mode;
@ -107,7 +108,7 @@ import java.util.ArrayList;
return true;
}
//@VisibleForTesting
@VisibleForTesting
/* package */ VorbisSetup readSetupHeaders(ParsableByteArray scratch) throws IOException {
if (vorbisIdHeader == null) {
@ -133,22 +134,22 @@ import java.util.ArrayList;
}
/**
* Reads an int of {@code length} bits from {@code src} starting at
* {@code leastSignificantBitIndex}.
* Reads an int of {@code length} bits from {@code src} starting at {@code
* leastSignificantBitIndex}.
*
* @param src the {@code byte} to read from.
* @param length the length in bits of the int to read.
* @param leastSignificantBitIndex the index of the least significant bit of the int to read.
* @return the int value read.
*/
//@VisibleForTesting
@VisibleForTesting
/* package */ static int readBits(byte src, int length, int leastSignificantBitIndex) {
return (src >> leastSignificantBitIndex) & (255 >>> (8 - length));
}
//@VisibleForTesting
/* package */ static void appendNumberOfSamples(ParsableByteArray buffer,
long packetSampleCount) {
@VisibleForTesting
/* package */ static void appendNumberOfSamples(
ParsableByteArray buffer, long packetSampleCount) {
buffer.setLimit(buffer.limit() + 4);
// The vorbis decoder expects the number of samples in the packet

View file

@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.text.ttml;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.text.Cue;
import com.google.android.exoplayer2.text.Subtitle;
@ -58,7 +59,7 @@ import java.util.Map;
return eventTimesUs[index];
}
/* @VisibleForTesting */
@VisibleForTesting
/* package */ TtmlNode getRoot() {
return root;
}
@ -68,7 +69,7 @@ import java.util.Map;
return root.getCues(timeUs, globalStyles, regionMap);
}
/* @VisibleForTesting */
@VisibleForTesting
/* package */ Map<String, TtmlStyle> getGlobalStyles() {
return globalStyles;
}

View file

@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.upstream.cache;
import android.support.annotation.VisibleForTesting;
import android.util.SparseArray;
import com.google.android.exoplayer2.upstream.cache.Cache.CacheException;
import com.google.android.exoplayer2.util.Assertions;
@ -336,7 +337,7 @@ import javax.crypto.spec.SecretKeySpec;
* than {@link java.lang.Integer#MAX_VALUE} it just returns the next bigger integer. Otherwise it
* returns the smallest unused non-negative integer.
*/
//@VisibleForTesting
@VisibleForTesting
public static int getNewId(SparseArray<String> idToKey) {
int size = idToKey.size();
int id = size == 0 ? 0 : (idToKey.keyAt(size - 1) + 1);

View file

@ -30,6 +30,7 @@ import android.support.annotation.AnyThread;
import android.support.annotation.BinderThread;
import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import android.support.annotation.VisibleForTesting;
import android.util.AttributeSet;
import android.view.Display;
import android.view.Surface;
@ -230,7 +231,7 @@ public final class SphericalSurfaceView extends GLSurfaceView {
* Standard GL Renderer implementation. The notable code is the matrix multiplication in
* onDrawFrame and updatePitchMatrix.
*/
// @VisibleForTesting
@VisibleForTesting
/* package */ class Renderer
implements GLSurfaceView.Renderer, TouchTracker.Listener, OrientationListener.Listener {
private final SceneRenderer scene;

View file

@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.PointF;
import android.support.annotation.BinderThread;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
@ -44,7 +45,7 @@ import android.view.View;
* a nicer UI. An even more advanced UI would reproject the user's touch point into 3D and drag the
* Mesh as the user moves their finger. However, that requires quaternion interpolation.
*/
// @VisibleForTesting
@VisibleForTesting
/* package */ class TouchTracker extends GestureDetector.SimpleOnGestureListener
implements View.OnTouchListener, OrientationListener.Listener {