Commit 92437f3a by kimvde Committed by Ian Baker

Remove some occurrences of dummy

Remove occurrences in comments and private fields.

ISSUE: #7565
PiperOrigin-RevId: 320948364
parent 5c9c0e20
Showing with 50 additions and 54 deletions
......@@ -690,7 +690,7 @@ public final class C {
public static final int TRACK_TYPE_METADATA = 4;
/** A type constant for camera motion tracks. */
public static final int TRACK_TYPE_CAMERA_MOTION = 5;
/** A type constant for a dummy or empty track. */
/** A type constant for a fake or empty track. */
public static final int TRACK_TYPE_NONE = 6;
/**
* Applications or extensions may define custom {@code TRACK_TYPE_*} constants greater than or
......
......@@ -33,9 +33,9 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class DashManifestTest {
private static final UtcTimingElement DUMMY_UTC_TIMING = new UtcTimingElement("", "");
private static final SingleSegmentBase DUMMY_SEGMENT_BASE = new SingleSegmentBase();
private static final Format DUMMY_FORMAT = new Format.Builder().build();
private static final UtcTimingElement UTC_TIMING = new UtcTimingElement("", "");
private static final SingleSegmentBase SEGMENT_BASE = new SingleSegmentBase();
private static final Format FORMAT = new Format.Builder().build();
@Test
public void copy() {
......@@ -214,8 +214,7 @@ public class DashManifestTest {
}
private static Representation newRepresentation() {
return Representation.newInstance(
/* revisionId= */ 0, DUMMY_FORMAT, /* baseUrl= */ "", DUMMY_SEGMENT_BASE);
return Representation.newInstance(/* revisionId= */ 0, FORMAT, /* baseUrl= */ "", SEGMENT_BASE);
}
private static DashManifest newDashManifest(int duration, Period... periods) {
......@@ -229,7 +228,7 @@ public class DashManifestTest {
/* suggestedPresentationDelayMs= */ 4,
/* publishTimeMs= */ 12345,
/* programInformation= */ null,
DUMMY_UTC_TIMING,
UTC_TIMING,
Uri.EMPTY,
Arrays.asList(periods));
}
......
......@@ -72,12 +72,12 @@ public class DownloadManagerDashTest {
private StreamKey fakeStreamKey2;
private TestDownloadManagerListener downloadManagerListener;
private DefaultDownloadIndex downloadIndex;
private DummyMainThread dummyMainThread;
private DummyMainThread testThread;
@Before
public void setUp() throws Exception {
ShadowLog.stream = System.out;
dummyMainThread = new DummyMainThread();
testThread = new DummyMainThread();
Context context = ApplicationProvider.getApplicationContext();
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
File cacheFolder = new File(tempFolder, "cache");
......@@ -105,7 +105,7 @@ public class DownloadManagerDashTest {
public void tearDown() {
runOnMainThread(() -> downloadManager.release());
Util.recursiveDelete(tempFolder);
dummyMainThread.release();
testThread.release();
}
// Disabled due to flakiness.
......@@ -144,7 +144,7 @@ public class DownloadManagerDashTest {
// Revert fakeDataSet to normal.
fakeDataSet.setData(TEST_MPD_URI, TEST_MPD);
dummyMainThread.runOnMainThread(this::createDownloadManager);
testThread.runOnMainThread(this::createDownloadManager);
// Block on the test thread.
downloadManagerListener.blockUntilIdleAndThrowAnyFailure();
......@@ -252,6 +252,6 @@ public class DownloadManagerDashTest {
}
private void runOnMainThread(TestRunnable r) {
dummyMainThread.runTestOnMainThread(r);
testThread.runTestOnMainThread(r);
}
}
......@@ -72,11 +72,11 @@ public class DownloadServiceDashTest {
private DownloadService dashDownloadService;
private ConditionVariable pauseDownloadCondition;
private TestDownloadManagerListener downloadManagerListener;
private DummyMainThread dummyMainThread;
private DummyMainThread testThread;
@Before
public void setUp() throws IOException {
dummyMainThread = new DummyMainThread();
testThread = new DummyMainThread();
context = ApplicationProvider.getApplicationContext();
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
......@@ -109,7 +109,7 @@ public class DownloadServiceDashTest {
fakeStreamKey1 = new StreamKey(0, 0, 0);
fakeStreamKey2 = new StreamKey(0, 1, 0);
dummyMainThread.runTestOnMainThread(
testThread.runTestOnMainThread(
() -> {
DefaultDownloadIndex downloadIndex =
new DefaultDownloadIndex(TestUtil.getInMemoryDatabaseProvider());
......@@ -148,9 +148,9 @@ public class DownloadServiceDashTest {
@After
public void tearDown() {
dummyMainThread.runOnMainThread(() -> dashDownloadService.onDestroy());
testThread.runOnMainThread(() -> dashDownloadService.onDestroy());
Util.recursiveDelete(tempFolder);
dummyMainThread.release();
testThread.release();
}
@Ignore // b/78877092
......@@ -192,7 +192,7 @@ public class DownloadServiceDashTest {
}
private void removeAll() {
dummyMainThread.runOnMainThread(
testThread.runOnMainThread(
() -> {
Intent startIntent =
DownloadService.buildRemoveDownloadIntent(
......@@ -212,7 +212,7 @@ public class DownloadServiceDashTest {
keysList,
/* customCacheKey= */ null,
null);
dummyMainThread.runOnMainThread(
testThread.runOnMainThread(
() -> {
Intent startIntent =
DownloadService.buildAddDownloadIntent(
......
......@@ -15,7 +15,7 @@
*/
package com.google.android.exoplayer2.extractor;
/** A dummy {@link ExtractorOutput} implementation. */
/** A fake {@link ExtractorOutput} implementation. */
public final class DummyExtractorOutput implements ExtractorOutput {
@Override
......
......@@ -23,9 +23,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray;
import java.io.EOFException;
import java.io.IOException;
/**
* A dummy {@link TrackOutput} implementation.
*/
/** A fake {@link TrackOutput} implementation. */
public final class DummyTrackOutput implements TrackOutput {
// Even though read data is discarded, data source implementations could be making use of the
......
......@@ -246,8 +246,8 @@ public class MatroskaExtractor implements Extractor {
* <p>The display time of each subtitle is passed as {@code timeUs} to {@link
* TrackOutput#sampleMetadata}. The start and end timecodes in this template are relative to
* {@code timeUs}. Hence the start timecode is always zero. The 12 byte end timecode starting at
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a dummy value, and must be replaced with
* the duration of the subtitle.
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a placeholder value, and must be replaced
* with the duration of the subtitle.
*
* <p>Equivalent to the UTF-8 string: "1\n00:00:00,000 --> 00:00:00,000\n".
*/
......@@ -281,8 +281,8 @@ public class MatroskaExtractor implements Extractor {
* <p>The display time of each subtitle is passed as {@code timeUs} to {@link
* TrackOutput#sampleMetadata}. The start and end timecodes in this template are relative to
* {@code timeUs}. Hence the start timecode is always zero. The 12 byte end timecode starting at
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a dummy value, and must be replaced with
* the duration of the subtitle.
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a placeholder value, and must be replaced
* with the duration of the subtitle.
*
* <p>Equivalent to the UTF-8 string: "Dialogue: 0:00:00:00,0:00:00:00,".
*/
......
......@@ -576,8 +576,8 @@ public final class TsExtractor implements Extractor {
if (mode == MODE_HLS && id3Reader == null) {
// Setup an ID3 track regardless of whether there's a corresponding entry, in case one
// appears intermittently during playback. See [Internal: b/20261500].
EsInfo dummyEsInfo = new EsInfo(TS_STREAM_TYPE_ID3, null, null, Util.EMPTY_BYTE_ARRAY);
id3Reader = payloadReaderFactory.createPayloadReader(TS_STREAM_TYPE_ID3, dummyEsInfo);
EsInfo id3EsInfo = new EsInfo(TS_STREAM_TYPE_ID3, null, null, Util.EMPTY_BYTE_ARRAY);
id3Reader = payloadReaderFactory.createPayloadReader(TS_STREAM_TYPE_ID3, id3EsInfo);
id3Reader.init(timestampAdjuster, output,
new TrackIdGenerator(programNumber, TS_STREAM_TYPE_ID3, MAX_PID_PLUS_ONE));
}
......
......@@ -37,7 +37,7 @@ import java.io.IOException;
*/
public final class BundledHlsMediaChunkExtractor implements HlsMediaChunkExtractor {
private static final PositionHolder DUMMY_POSITION_HOLDER = new PositionHolder();
private static final PositionHolder POSITION_HOLDER = new PositionHolder();
@VisibleForTesting /* package */ final Extractor extractor;
private final Format masterPlaylistFormat;
......@@ -64,7 +64,7 @@ public final class BundledHlsMediaChunkExtractor implements HlsMediaChunkExtract
@Override
public boolean read(ExtractorInput extractorInput) throws IOException {
return extractor.read(extractorInput, DUMMY_POSITION_HOLDER) == Extractor.RESULT_CONTINUE;
return extractor.read(extractorInput, POSITION_HOLDER) == Extractor.RESULT_CONTINUE;
}
@Override
......
......@@ -941,7 +941,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
if (trackOutput == null) {
if (tracksEnded) {
return createDummyTrackOutput(id, type);
return createFakeTrackOutput(id, type);
} else {
// The relevant SampleQueue hasn't been constructed yet - so construct it.
trackOutput = createSampleQueue(id, type);
......@@ -985,7 +985,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
}
return sampleQueueTrackIds[sampleQueueIndex] == id
? sampleQueues[sampleQueueIndex]
: createDummyTrackOutput(id, type);
: createFakeTrackOutput(id, type);
}
private SampleQueue createSampleQueue(int id, int type) {
......@@ -1459,7 +1459,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
return true;
}
private static DummyTrackOutput createDummyTrackOutput(int id, int type) {
private static DummyTrackOutput createFakeTrackOutput(int id, int type) {
Log.w(TAG, "Unmapped track with id " + id + " of type " + type);
return new DummyTrackOutput();
}
......
......@@ -321,7 +321,7 @@ public class HlsMediaPlaylistParserTest {
+ "#EXT-X-KEY:METHOD=NONE\n"
+ "#EXTINF:5.005,\n"
+ "#EXT-X-GAP \n"
+ "../dummy.ts\n"
+ "../test.ts\n"
+ "#EXT-X-KEY:METHOD=AES-128,URI=\"https://key-service.bamgrid.com/1.0/key?"
+ "hex-value=9FB8989D15EEAAF8B21B860D7ED3072A\",IV=0x410C8AC18AA42EFA18B5155484F5FC34\n"
+ "#EXTINF:5.005,\n"
......
......@@ -35,7 +35,7 @@ public class TouchTrackerTest {
private TouchTracker tracker;
private float yaw;
private float pitch;
private float[] dummyMatrix;
private float[] matrix;
private static void swipe(TouchTracker tracker, float x0, float y0, float x1, float y1) {
tracker.onTouch(null, MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, x0, y0, 0));
......@@ -54,8 +54,8 @@ public class TouchTrackerTest {
yaw = scrollOffsetDegrees.x;
},
PX_PER_DEGREES);
dummyMatrix = new float[16];
tracker.onOrientationChange(dummyMatrix, 0);
matrix = new float[16];
tracker.onOrientationChange(matrix, 0);
}
@Test
......@@ -111,7 +111,7 @@ public class TouchTrackerTest {
@Test
public void withRoll90() {
tracker.onOrientationChange(dummyMatrix, (float) Math.toRadians(90));
tracker.onOrientationChange(matrix, (float) Math.toRadians(90));
// Y-axis should now control yaw.
swipe(tracker, 0, 0, 0, 2 * SWIPE_PX);
......@@ -124,7 +124,7 @@ public class TouchTrackerTest {
@Test
public void withRoll180() {
tracker.onOrientationChange(dummyMatrix, (float) Math.toRadians(180));
tracker.onOrientationChange(matrix, (float) Math.toRadians(180));
// X-axis should now control reverse yaw.
swipe(tracker, 0, 0, -2 * SWIPE_PX, 0);
......@@ -137,7 +137,7 @@ public class TouchTrackerTest {
@Test
public void withRoll270() {
tracker.onOrientationChange(dummyMatrix, (float) Math.toRadians(270));
tracker.onOrientationChange(matrix, (float) Math.toRadians(270));
// Y-axis should now control reverse yaw.
swipe(tracker, 0, 0, 0, -2 * SWIPE_PX);
......
......@@ -11,13 +11,13 @@
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
<Representation id="140" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="144000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<BaseURL>http://www.dummy.url/</BaseURL>
<BaseURL>http://www.test.url/</BaseURL>
</Representation>
</AdaptationSet>
<AdaptationSet id="1" mimeType="video/mp4" subsegmentAlignment="true">
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
<Representation id="133" codecs="avc1.4d4015" width="426" height="240" startWithSAP="1" maxPlayoutRate="1" bandwidth="258000" frameRate="30">
<BaseURL>http://www.dummy.url/</BaseURL>
<BaseURL>http://www.test.url/</BaseURL>
</Representation>
</AdaptationSet>
</Period>
......
......@@ -33,13 +33,13 @@
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
<Representation id="140" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="144000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<BaseURL>http://www.dummy.url/</BaseURL>
<BaseURL>http://www.test.url/</BaseURL>
</Representation>
</AdaptationSet>
<AdaptationSet id="1" mimeType="video/mp4" subsegmentAlignment="true">
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
<Representation id="133" codecs="avc1.4d4015" width="426" height="240" startWithSAP="1" maxPlayoutRate="1" bandwidth="258000" frameRate="30">
<BaseURL>http://www.dummy.url/</BaseURL>
<BaseURL>http://www.test.url/</BaseURL>
</Representation>
</AdaptationSet>
</Period>
......
......@@ -52,8 +52,7 @@ public final class FakeTimeline extends Timeline {
public final AdPlaybackState adPlaybackState;
/**
* Creates a window definition that corresponds to a dummy placeholder timeline using the given
* tag.
* Creates a window definition that corresponds to a placeholder timeline using the given tag.
*
* @param tag The tag to use in the timeline.
*/
......
......@@ -199,9 +199,9 @@ public final class MediaPeriodAsserts {
private static TrackGroupArray prepareAndGetTrackGroups(MediaPeriod mediaPeriod) {
AtomicReference<TrackGroupArray> trackGroupArray = new AtomicReference<>();
DummyMainThread dummyMainThread = new DummyMainThread();
DummyMainThread testThread = new DummyMainThread();
ConditionVariable preparedCondition = new ConditionVariable();
dummyMainThread.runOnMainThread(
testThread.runOnMainThread(
() ->
mediaPeriod.prepare(
new Callback() {
......@@ -222,7 +222,7 @@ public final class MediaPeriodAsserts {
} catch (InterruptedException e) {
// Ignore.
}
dummyMainThread.release();
testThread.release();
return trackGroupArray.get();
}
......
......@@ -198,17 +198,17 @@ public class TestUtil {
return ImmutableList.copyOf(Bytes.asList(createByteArray(bytes)));
}
/** Writes one byte long dummy test data to the file and returns it. */
/** Writes one byte long test data to the file and returns it. */
public static File createTestFile(File directory, String name) throws IOException {
return createTestFile(directory, name, /* length= */ 1);
}
/** Writes dummy test data with the specified length to the file and returns it. */
/** Writes test data with the specified length to the file and returns it. */
public static File createTestFile(File directory, String name, long length) throws IOException {
return createTestFile(new File(directory, name), length);
}
/** Writes dummy test data with the specified length to the file and returns it. */
/** Writes test data with the specified length to the file and returns it. */
public static File createTestFile(File file, long length) throws IOException {
FileOutputStream output = new FileOutputStream(file);
for (long i = 0; i < length; i++) {
......
......@@ -97,7 +97,7 @@ public final class FakeDataSourceTest {
}
@Test
public void testDummyData() throws IOException {
public void testFakeData() throws IOException {
FakeDataSource dataSource =
new FakeDataSource(
new FakeDataSet()
......
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