Commit 7a114cb3 by eguven Committed by Oliver Woodman

Uncomment VisibleForTesting annotations

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220432564
parent d7e23f82
...@@ -21,6 +21,7 @@ import android.os.Looper; ...@@ -21,6 +21,7 @@ import android.os.Looper;
import android.os.SystemClock; import android.os.SystemClock;
import android.support.annotation.IntDef; import android.support.annotation.IntDef;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.view.ViewGroup; import android.view.ViewGroup;
import com.google.ads.interactivemedia.v3.api.Ad; import com.google.ads.interactivemedia.v3.api.Ad;
import com.google.ads.interactivemedia.v3.api.AdDisplayContainer; import com.google.ads.interactivemedia.v3.api.AdDisplayContainer;
...@@ -206,7 +207,7 @@ public final class ImaAdsLoader ...@@ -206,7 +207,7 @@ public final class ImaAdsLoader
return this; return this;
} }
// @VisibleForTesting @VisibleForTesting
/* package */ Builder setImaFactory(ImaFactory imaFactory) { /* package */ Builder setImaFactory(ImaFactory imaFactory) {
this.imaFactory = Assertions.checkNotNull(imaFactory); this.imaFactory = Assertions.checkNotNull(imaFactory);
return this; return this;
...@@ -1346,7 +1347,7 @@ public final class ImaAdsLoader ...@@ -1346,7 +1347,7 @@ public final class ImaAdsLoader
} }
/** Factory for objects provided by the IMA SDK. */ /** Factory for objects provided by the IMA SDK. */
// @VisibleForTesting @VisibleForTesting
/* package */ interface ImaFactory { /* package */ interface ImaFactory {
/** @see ImaSdkSettings */ /** @see ImaSdkSettings */
ImaSdkSettings createImaSdkSettings(); ImaSdkSettings createImaSdkSettings();
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.extractor.ogg; package com.google.android.exoplayer2.extractor.ogg;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorInput;
import com.google.android.exoplayer2.extractor.SeekMap; import com.google.android.exoplayer2.extractor.SeekMap;
...@@ -26,10 +27,8 @@ import java.io.IOException; ...@@ -26,10 +27,8 @@ import java.io.IOException;
/** Seeks in an Ogg stream. */ /** Seeks in an Ogg stream. */
/* package */ final class DefaultOggSeeker implements OggSeeker { /* package */ final class DefaultOggSeeker implements OggSeeker {
//@VisibleForTesting @VisibleForTesting public static final int MATCH_RANGE = 72000;
public static final int MATCH_RANGE = 72000; @VisibleForTesting public static final int MATCH_BYTE_RANGE = 100000;
//@VisibleForTesting
public static final int MATCH_BYTE_RANGE = 100000;
private static final int DEFAULT_OFFSET = 30000; private static final int DEFAULT_OFFSET = 30000;
private static final int STATE_SEEK_TO_END = 0; private static final int STATE_SEEK_TO_END = 0;
...@@ -133,7 +132,7 @@ import java.io.IOException; ...@@ -133,7 +132,7 @@ import java.io.IOException;
return totalGranules != 0 ? new OggSeekMap() : null; return totalGranules != 0 ? new OggSeekMap() : null;
} }
//@VisibleForTesting @VisibleForTesting
public void resetSeeking() { public void resetSeeking() {
start = startPosition; start = startPosition;
end = endPosition; end = endPosition;
...@@ -150,12 +149,12 @@ import java.io.IOException; ...@@ -150,12 +149,12 @@ import java.io.IOException;
* *
* @param targetGranule the target granule position to seek to. * @param targetGranule the target granule position to seek to.
* @param input the {@link ExtractorInput} to read from. * @param input the {@link ExtractorInput} to read from.
* @return the position to seek the {@link ExtractorInput} to for a next call or * @return the position to seek the {@link ExtractorInput} to for a next call or -(currentGranule
* -(currentGranule + 2) if it's close enough to skip to the target page. * + 2) if it's close enough to skip to the target page.
* @throws IOException thrown if reading from the input fails. * @throws IOException thrown if reading from the input fails.
* @throws InterruptedException thrown if interrupted while reading from the input. * @throws InterruptedException thrown if interrupted while reading from the input.
*/ */
//@VisibleForTesting @VisibleForTesting
public long getNextSeekPosition(long targetGranule, ExtractorInput input) public long getNextSeekPosition(long targetGranule, ExtractorInput input)
throws IOException, InterruptedException { throws IOException, InterruptedException {
if (start == end) { if (start == end) {
...@@ -250,7 +249,7 @@ import java.io.IOException; ...@@ -250,7 +249,7 @@ import java.io.IOException;
* @throws InterruptedException If the thread is interrupted. * @throws InterruptedException If the thread is interrupted.
* @throws EOFException If the next page can't be found before the end of the input. * @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 { void skipToNextPage(ExtractorInput input) throws IOException, InterruptedException {
if (!skipToNextPage(input, endPosition)) { if (!skipToNextPage(input, endPosition)) {
// Not found until eof. // Not found until eof.
...@@ -267,7 +266,7 @@ import java.io.IOException; ...@@ -267,7 +266,7 @@ import java.io.IOException;
* @throws IOException thrown if peeking/reading from the input fails. * @throws IOException thrown if peeking/reading from the input fails.
* @throws InterruptedException thrown if interrupted while peeking/reading from the input. * @throws InterruptedException thrown if interrupted while peeking/reading from the input.
*/ */
// @VisibleForTesting @VisibleForTesting
boolean skipToNextPage(ExtractorInput input, long limit) boolean skipToNextPage(ExtractorInput input, long limit)
throws IOException, InterruptedException { throws IOException, InterruptedException {
limit = Math.min(limit + 3, endPosition); limit = Math.min(limit + 3, endPosition);
...@@ -307,7 +306,7 @@ import java.io.IOException; ...@@ -307,7 +306,7 @@ import java.io.IOException;
* @throws IOException If reading from the input fails. * @throws IOException If reading from the input fails.
* @throws InterruptedException If the thread is interrupted. * @throws InterruptedException If the thread is interrupted.
*/ */
// @VisibleForTesting @VisibleForTesting
long readGranuleOfLastPage(ExtractorInput input) throws IOException, InterruptedException { long readGranuleOfLastPage(ExtractorInput input) throws IOException, InterruptedException {
skipToNextPage(input); skipToNextPage(input);
pageHeader.reset(); pageHeader.reset();
...@@ -319,8 +318,8 @@ import java.io.IOException; ...@@ -319,8 +318,8 @@ import java.io.IOException;
} }
/** /**
* Skips to the position of the start of the page containing the {@code targetGranule} and * Skips to the position of the start of the page containing the {@code targetGranule} and returns
* returns the granule of the page previous to the target page. * the granule of the page previous to the target page.
* *
* @param input the {@link ExtractorInput} to read from. * @param input the {@link ExtractorInput} to read from.
* @param targetGranule the target granule. * @param targetGranule the target granule.
...@@ -331,7 +330,7 @@ import java.io.IOException; ...@@ -331,7 +330,7 @@ import java.io.IOException;
* @throws IOException thrown if reading from the input fails. * @throws IOException thrown if reading from the input fails.
* @throws InterruptedException thrown if interrupted while reading from the input. * @throws InterruptedException thrown if interrupted while reading from the input.
*/ */
//@VisibleForTesting @VisibleForTesting
long skipToPageOfGranule(ExtractorInput input, long targetGranule, long currentGranule) long skipToPageOfGranule(ExtractorInput input, long targetGranule, long currentGranule)
throws IOException, InterruptedException { throws IOException, InterruptedException {
pageHeader.populate(input, false); pageHeader.populate(input, false);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.extractor.ogg; package com.google.android.exoplayer2.extractor.ogg;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorInput;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
...@@ -103,14 +104,14 @@ import java.util.Arrays; ...@@ -103,14 +104,14 @@ import java.util.Arrays;
/** /**
* An OGG Packet may span multiple pages. Returns the {@link OggPageHeader} of the last page read, * 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. * 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)}. * calls to {@link #populate(ExtractorInput)}.
* *
* @return the {@code PageHeader} of the last page read or an empty header if the packet has yet * @return the {@code PageHeader} of the last page read or an empty header if the packet has yet
* to be populated. * to be populated.
*/ */
//@VisibleForTesting @VisibleForTesting
public OggPageHeader getPageHeader() { public OggPageHeader getPageHeader() {
return pageHeader; return pageHeader;
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.extractor.ogg; package com.google.android.exoplayer2.extractor.ogg;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.ogg.VorbisUtil.Mode; import com.google.android.exoplayer2.extractor.ogg.VorbisUtil.Mode;
...@@ -107,7 +108,7 @@ import java.util.ArrayList; ...@@ -107,7 +108,7 @@ import java.util.ArrayList;
return true; return true;
} }
//@VisibleForTesting @VisibleForTesting
/* package */ VorbisSetup readSetupHeaders(ParsableByteArray scratch) throws IOException { /* package */ VorbisSetup readSetupHeaders(ParsableByteArray scratch) throws IOException {
if (vorbisIdHeader == null) { if (vorbisIdHeader == null) {
...@@ -133,22 +134,22 @@ import java.util.ArrayList; ...@@ -133,22 +134,22 @@ import java.util.ArrayList;
} }
/** /**
* Reads an int of {@code length} bits from {@code src} starting at * Reads an int of {@code length} bits from {@code src} starting at {@code
* {@code leastSignificantBitIndex}. * leastSignificantBitIndex}.
* *
* @param src the {@code byte} to read from. * @param src the {@code byte} to read from.
* @param length the length in bits of the int to read. * @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. * @param leastSignificantBitIndex the index of the least significant bit of the int to read.
* @return the int value read. * @return the int value read.
*/ */
//@VisibleForTesting @VisibleForTesting
/* package */ static int readBits(byte src, int length, int leastSignificantBitIndex) { /* package */ static int readBits(byte src, int length, int leastSignificantBitIndex) {
return (src >> leastSignificantBitIndex) & (255 >>> (8 - length)); return (src >> leastSignificantBitIndex) & (255 >>> (8 - length));
} }
//@VisibleForTesting @VisibleForTesting
/* package */ static void appendNumberOfSamples(ParsableByteArray buffer, /* package */ static void appendNumberOfSamples(
long packetSampleCount) { ParsableByteArray buffer, long packetSampleCount) {
buffer.setLimit(buffer.limit() + 4); buffer.setLimit(buffer.limit() + 4);
// The vorbis decoder expects the number of samples in the packet // The vorbis decoder expects the number of samples in the packet
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.text.ttml; package com.google.android.exoplayer2.text.ttml;
import android.support.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.text.Cue; import com.google.android.exoplayer2.text.Cue;
import com.google.android.exoplayer2.text.Subtitle; import com.google.android.exoplayer2.text.Subtitle;
...@@ -58,7 +59,7 @@ import java.util.Map; ...@@ -58,7 +59,7 @@ import java.util.Map;
return eventTimesUs[index]; return eventTimesUs[index];
} }
/* @VisibleForTesting */ @VisibleForTesting
/* package */ TtmlNode getRoot() { /* package */ TtmlNode getRoot() {
return root; return root;
} }
...@@ -68,7 +69,7 @@ import java.util.Map; ...@@ -68,7 +69,7 @@ import java.util.Map;
return root.getCues(timeUs, globalStyles, regionMap); return root.getCues(timeUs, globalStyles, regionMap);
} }
/* @VisibleForTesting */ @VisibleForTesting
/* package */ Map<String, TtmlStyle> getGlobalStyles() { /* package */ Map<String, TtmlStyle> getGlobalStyles() {
return globalStyles; return globalStyles;
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.upstream.cache; package com.google.android.exoplayer2.upstream.cache;
import android.support.annotation.VisibleForTesting;
import android.util.SparseArray; import android.util.SparseArray;
import com.google.android.exoplayer2.upstream.cache.Cache.CacheException; import com.google.android.exoplayer2.upstream.cache.Cache.CacheException;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
...@@ -336,7 +337,7 @@ import javax.crypto.spec.SecretKeySpec; ...@@ -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 * than {@link java.lang.Integer#MAX_VALUE} it just returns the next bigger integer. Otherwise it
* returns the smallest unused non-negative integer. * returns the smallest unused non-negative integer.
*/ */
//@VisibleForTesting @VisibleForTesting
public static int getNewId(SparseArray<String> idToKey) { public static int getNewId(SparseArray<String> idToKey) {
int size = idToKey.size(); int size = idToKey.size();
int id = size == 0 ? 0 : (idToKey.keyAt(size - 1) + 1); int id = size == 0 ? 0 : (idToKey.keyAt(size - 1) + 1);
......
...@@ -30,6 +30,7 @@ import android.support.annotation.AnyThread; ...@@ -30,6 +30,7 @@ import android.support.annotation.AnyThread;
import android.support.annotation.BinderThread; import android.support.annotation.BinderThread;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.annotation.UiThread; import android.support.annotation.UiThread;
import android.support.annotation.VisibleForTesting;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.Display; import android.view.Display;
import android.view.Surface; import android.view.Surface;
...@@ -230,7 +231,7 @@ public final class SphericalSurfaceView extends GLSurfaceView { ...@@ -230,7 +231,7 @@ public final class SphericalSurfaceView extends GLSurfaceView {
* Standard GL Renderer implementation. The notable code is the matrix multiplication in * Standard GL Renderer implementation. The notable code is the matrix multiplication in
* onDrawFrame and updatePitchMatrix. * onDrawFrame and updatePitchMatrix.
*/ */
// @VisibleForTesting @VisibleForTesting
/* package */ class Renderer /* package */ class Renderer
implements GLSurfaceView.Renderer, TouchTracker.Listener, OrientationListener.Listener { implements GLSurfaceView.Renderer, TouchTracker.Listener, OrientationListener.Listener {
private final SceneRenderer scene; private final SceneRenderer scene;
......
...@@ -19,6 +19,7 @@ import android.content.Context; ...@@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.PointF; import android.graphics.PointF;
import android.support.annotation.BinderThread; import android.support.annotation.BinderThread;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.view.GestureDetector; import android.view.GestureDetector;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
...@@ -44,7 +45,7 @@ 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 * 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. * Mesh as the user moves their finger. However, that requires quaternion interpolation.
*/ */
// @VisibleForTesting @VisibleForTesting
/* package */ class TouchTracker extends GestureDetector.SimpleOnGestureListener /* package */ class TouchTracker extends GestureDetector.SimpleOnGestureListener
implements View.OnTouchListener, OrientationListener.Listener { implements View.OnTouchListener, OrientationListener.Listener {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment