int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2;
MediaTransport fakeTransport = new MediaTransport(contentLength);
fakeTransport.directUploadEnabled = true;
fakeTransport.contentLengthNotSpecified = true;
InputStream is = new ByteArrayInputStream(new byte[contentLength]);
InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is);
MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null);
DirectProgressListener listener = new DirectProgressListener();
listener.contentLengthNotSpecified = true;
uploader.setProgressListener(listener);
// Enable direct media upload.