Esempio n. 1
0
        /// <summary>
        /// Test the successful local to remote playback and then remote to local
        /// with the media starting in the PLAY state on the local device. </summary>
        /// <exception cref="InterruptedException"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testCastMediaToRemoteDeviceAndBackFromPlaying() throws InterruptedException
        public virtual void testCastMediaToRemoteDeviceAndBackFromPlaying()
        {
            Log.v(TAG, "testCastMediaToRemoteDeviceAndBackFromPlaying");
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.concurrent.CountDownLatch countDownLatch = new java.util.concurrent.CountDownLatch(2);
            CountDownLatch countDownLatch = new CountDownLatch(2);

            solo.clickOnActionBarItem(R.id.media_router_menu_item);
            solo.clickInList(0);

            eventEmitter.once(EventType.DID_PAUSE, new EventListenerAnonymousInnerClassHelper3(this, countDownLatch));
            solo.waitForActivity(typeof(VideoCastControllerActivity));
            solo.sleep(10000);

            solo.assertCurrentActivity("VideoCastControllerActivity is displayed", typeof(VideoCastControllerActivity));

            IList <View> views = solo.CurrentViews;

            foreach (View v in views)
            {
                if (v is android.support.v7.app.MediaRouteButton)
                {
                    solo.clickOnView(v);
                }
            }
            solo.sleep(3000);

            solo.clickOnButton("Disconnect");
            solo.sleep(3000);

            countDownLatch.countDown();

            assertTrue("Timeout occurred.", countDownLatch.@await(3, TimeUnit.MINUTES));
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void setUp() throws Exception
        protected internal override void setUp()
        {
            base.setUp();
            ActivityInitialTouchMode = false;
            mainActivity             = Activity;
            brightcoveVideoView      = (BrightcoveVideoView)mainActivity.findViewById(R.id.brightcove_video_view);
            eventEmitter             = brightcoveVideoView.EventEmitter;

            eventEmitter.once(EventType.DID_SET_VIDEO, new EventListenerAnonymousInnerClassHelper(this));
        }
Esempio n. 3
0
        /// <summary>
        /// Initialize Robotium, the BrightcoveVideoView and the EventEmitter.
        /// Start media playback. </summary>
        /// <exception cref="Exception"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void setUp() throws Exception
        protected internal override void setUp()
        {
            base.setUp();
            ActivityInitialTouchMode = true;
            castActivity             = Activity;

            solo = new Solo(Instrumentation, castActivity);
            brightcoveVideoView = (BrightcoveVideoView)castActivity.findViewById(R.id.brightcove_video_view);
            eventEmitter        = brightcoveVideoView.EventEmitter;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.concurrent.CountDownLatch countDownLatch = new java.util.concurrent.CountDownLatch(2);
            CountDownLatch countDownLatch = new CountDownLatch(2);

            eventEmitter.once(EventType.DID_SET_VIDEO, new EventListenerAnonymousInnerClassHelper(this, countDownLatch));

            eventEmitter.once(EventType.DID_PLAY, new EventListenerAnonymousInnerClassHelper2(this, countDownLatch));

            assertTrue("Timeout occurred.", countDownLatch.@await(1, TimeUnit.MINUTES));
        }
Esempio n. 4
0
        public EventEmitter once(string eventName, JSCallback listener)
        {
            EventEmitter emitter = API.ConvertTypeTemporary <EventEmitter>();

            return(emitter.once(eventName, listener));
        }