/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
gEvaluateJavaScriptCallbackCalled++;
}
-static bool OnTouched( Actor actor, const Dali::TouchData& touch )
+static bool OnTouched( Actor actor, const Dali::TouchEvent& touch )
{
gTouched = true;
return true;
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 ) );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( view );
view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
application.SendNotification();
application.Render();
view.GetNaturalSize();
- view.TouchSignal().Connect( &OnTouched );
+ view.TouchedSignal().Connect( &OnTouched );
// Touch event
Dali::Integration::TouchEvent event;
// Key event
Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( view );
- application.ProcessEvent( Integration::KeyEvent( "", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", "", Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( Integration::KeyEvent( "", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
DALI_TEST_CHECK( gTouched );
END_TEST;
}
+int UtcDaliWebViewFocusGainedAndLost(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.SetKeyInputFocus();
+ DALI_TEST_CHECK( view.HasKeyInputFocus() );
+
+ // reset
+ view.ClearKeyInputFocus();
+ DALI_TEST_CHECK( !view.HasKeyInputFocus() );
+
+ END_TEST;
+}
+
int UtcDaliWebViewProperty1(void)
{
// URL