+int UtcDaliAnimationProgressSignalWithPlayAfterP(void)
+{
+ tet_infoline( "Multiple animations with different progress markers" );
+
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ Animation animationAlpha = Animation::New(0.0f);
+ Animation animationBeta = Animation::New(0.0f);
+
+ //Set duration
+ float durationSeconds(1.0f);
+ float delaySeconds(0.5f);
+ animationAlpha.SetDuration(durationSeconds);
+ animationBeta.SetDuration(durationSeconds);
+
+ bool progressSignalReceivedAlpha(false);
+ bool progressSignalReceivedBeta(false);
+
+ AnimationProgressCheck progressCheckAlpha(progressSignalReceivedAlpha, "animation:Alpha");
+ AnimationProgressCheck progressCheckBeta(progressSignalReceivedBeta, "animation:Beta" );
+
+ DevelAnimation::ProgressReachedSignal( animationAlpha ).Connect( &application, progressCheckAlpha );
+ DevelAnimation::ProgressReachedSignal( animationBeta ).Connect( &application, progressCheckBeta);
+ application.SendNotification();
+
+ Vector3 targetPosition(100.0f, 100.0f, 100.0f);
+ animationAlpha.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+ animationBeta.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+
+ tet_infoline( "AnimationAlpha Progress notification set to 30%" );
+ DevelAnimation::SetProgressNotification( animationAlpha, 0.3f );
+
+ tet_infoline( "AnimationBeta Progress notification set to ~0% (==Notify when delay is done)" );
+ DevelAnimation::SetProgressNotification( animationBeta, Math::MACHINE_EPSILON_1 );
+
+ application.SendNotification();
+ application.Render( );
+
+ progressCheckAlpha.CheckSignalNotReceived();
+ progressCheckBeta.CheckSignalNotReceived();
+
+ // Start the animations from 10% progress
+ animationAlpha.PlayAfter(delaySeconds);
+ animationBeta.PlayAfter(delaySeconds);
+
+ application.SendNotification();
+ application.Render(0); // start animation
+ application.Render(delaySeconds * 500.0f ); // 50% wait progress
+
+ tet_infoline( "Delay at 50% - No signals to be received" );
+
+ progressCheckAlpha.CheckSignalNotReceived();
+ progressCheckBeta.CheckSignalNotReceived();
+
+ application.SendNotification();
+ application.Render(delaySeconds * 500.0f + durationSeconds * 50.0f ); // 100% wait, 5% progress
+ application.SendNotification();
+ tet_infoline( "Delay at 100%, Animation at 5% - Beta signal should be received" );
+ DALI_TEST_EQUALS( 0.05f, animationBeta.GetCurrentProgress(), TEST_LOCATION );
+
+ progressCheckBeta.CheckSignalReceived();
+ progressCheckAlpha.CheckSignalNotReceived();
+
+ tet_infoline( "Progress check reset" );
+ progressCheckAlpha.Reset();
+ progressCheckBeta.Reset();
+
+ application.Render(durationSeconds * 200.0f ); // 25% progress
+ tet_infoline( "Animation at 25% - No signals to be received" );
+ application.SendNotification();
+
+ progressCheckAlpha.CheckSignalNotReceived();
+ progressCheckBeta.CheckSignalNotReceived();
+
+ application.Render(durationSeconds * 200.0f ); // 45% progress
+ tet_infoline( "Animation at 45% - Alpha should receive signal, Beta should not" );
+ application.SendNotification();
+
+ DALI_TEST_EQUALS( 0.45f, animationAlpha.GetCurrentProgress(), TEST_LOCATION );
+
+ progressCheckAlpha.CheckSignalReceived();
+ progressCheckBeta.CheckSignalNotReceived();
+
+ tet_infoline( "Progress check reset" );
+ progressCheckAlpha.Reset();
+ progressCheckBeta.Reset();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*150.0f)/* 60% progress */);
+ application.SendNotification();
+
+ tet_infoline( "Animation at 60%" );
+
+ progressCheckAlpha.CheckSignalNotReceived();
+ progressCheckBeta.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 80% progress */);
+ application.SendNotification();
+ tet_infoline( "Animation at 80%" );
+
+ progressCheckAlpha.CheckSignalNotReceived();
+ progressCheckBeta.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/);
+ // We did expect the animation to finish
+ tet_infoline( "Animation finished" );
+
+ END_TEST;
+}