+int UtcDaliWebViewPropertyMouseEventsEnabled(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ DALI_TEST_CHECK( view );
+
+ const bool kDefaultValue = true;
+ const bool kTestValue = false;
+
+ // Check default value
+ bool output;
+ Property::Value value = view.GetProperty( WebView::Property::MOUSE_EVENTS_ENABLED );
+ DALI_TEST_CHECK( value.Get( output ) );
+ DALI_TEST_EQUALS( output, kDefaultValue, TEST_LOCATION );
+
+ // Check Set/GetProperty
+ view.SetProperty( WebView::Property::MOUSE_EVENTS_ENABLED, kTestValue );
+ value = view.GetProperty( WebView::Property::MOUSE_EVENTS_ENABLED );
+ DALI_TEST_CHECK( value.Get( output ) );
+ DALI_TEST_EQUALS( output, kTestValue, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliWebViewPropertyKeyEventsEnabled(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ DALI_TEST_CHECK( view );
+
+ const bool kDefaultValue = true;
+ const bool kTestValue = false;
+
+ // Check default value
+ bool output;
+ Property::Value value = view.GetProperty( WebView::Property::KEY_EVENTS_ENABLED );
+ DALI_TEST_CHECK( value.Get( output ) );
+ DALI_TEST_EQUALS( output, kDefaultValue, TEST_LOCATION );
+
+ // Check Set/GetProperty
+ view.SetProperty( WebView::Property::KEY_EVENTS_ENABLED, kTestValue );
+ value = view.GetProperty( WebView::Property::KEY_EVENTS_ENABLED );
+ DALI_TEST_CHECK( value.Get( output ) );
+ DALI_TEST_EQUALS( output, kTestValue, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliWebViewHoverAndWheel(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ DALI_TEST_CHECK( view );
+ view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+ view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+
+ application.GetScene().Add( view );
+ application.SendNotification();
+ application.Render();
+
+ view.GetNaturalSize();
+ view.HoveredSignal().Connect( &OnHovered );
+ view.WheelEventSignal().Connect( &OnWheelEvent );
+
+ // Hover event
+ Dali::Integration::HoverEvent event = Dali::Integration::HoverEvent();
+ Dali::Integration::Point pointDown;
+ pointDown.SetState( PointState::DOWN );
+ pointDown.SetScreenPosition( Vector2( 10, 10 ) );
+ event.AddPoint( pointDown );
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::HoverEvent();
+ Dali::Integration::Point pointUp;
+ pointUp.SetState( PointState::UP );
+ pointUp.SetScreenPosition( Vector2( 10, 10 ) );
+ event.AddPoint( pointUp );
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::HoverEvent();
+ Dali::Integration::Point pointMotion;
+ pointUp.SetState( PointState::MOTION );
+ pointUp.SetScreenPosition( Vector2( 10, 10 ) );
+ event.AddPoint( pointMotion );
+ application.ProcessEvent( event );
+
+ // Wheel event
+ Dali::Integration::WheelEvent wheelEvent;
+ wheelEvent.type = Dali::Integration::WheelEvent::Type::MOUSE_WHEEL;
+ wheelEvent.direction = 0;
+ wheelEvent.point = Vector2( 20, 20 );
+ wheelEvent.delta = 10;
+ application.ProcessEvent( wheelEvent );
+ application.SendNotification();
+
+ DALI_TEST_CHECK( gHovered );
+ DALI_TEST_CHECK( gWheelEventHandled );
+
+ END_TEST;
+}
+
+int UtcDaliWebViewFormRepostDecisionFrameRendering(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+ view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ application.GetScene().Add( view );
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( view );
+
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ view.FormRepostDecisionSignal().Connect(&OnFormRepostDecision);
+ view.FrameRenderedSignal().Connect(&OnFrameRendered);
+ bool signal1 = false;
+ bool signal2 = false;
+ view.ConnectSignal( testTracker, "formRepostDecision", CallbackFunctor(&signal1) );
+ view.ConnectSignal( testTracker, "frameRendered", CallbackFunctor(&signal2) );
+ DALI_TEST_EQUALS( gFormRepostDecisionCallbackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( gFrameRenderedCallbackCalled, 0, TEST_LOCATION );
+
+ view.LoadUrl( TEST_URL1 );
+ Test::EmitGlobalTimerSignal();
+ DALI_TEST_EQUALS( gFormRepostDecisionCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( gFrameRenderedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_CHECK( signal1 & signal2);
+
+ // form repost decision.
+ DALI_TEST_CHECK(gFormRepostDecisionInstance);
+ gFormRepostDecisionInstance->Reply(true);
+
+ // reset
+ gFormRepostDecisionInstance = nullptr;
+
+ END_TEST;
+}
+