summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/elm_test_entry.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_entry.c b/src/tests/elementary/elm_test_entry.c
index cbeaed1d10..5033798f7d 100644
--- a/src/tests/elementary/elm_test_entry.c
+++ b/src/tests/elementary/elm_test_entry.c
@@ -393,6 +393,85 @@ EFL_START_TEST(elm_atspi_role_get)
393} 393}
394EFL_END_TEST 394EFL_END_TEST
395 395
396static Eina_Bool
397end_test()
398{
399 ecore_main_loop_quit();
400 return EINA_FALSE;
401}
402
403static void
404mag_job(void *e)
405{
406 evas_event_feed_mouse_out(e, 0, NULL);
407 evas_event_feed_mouse_in(e, 0, NULL);
408 evas_event_feed_mouse_move(e, 200, 100, 0, NULL);
409 evas_event_feed_mouse_down(e, 1, 0, 0, NULL);
410 real_timer_add(elm_config_longpress_timeout_get() + 0.1, end_test, NULL);
411}
412
413static void
414norendered(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED)
415{
416 ecore_job_add(mag_job, e);
417 evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, norendered);
418}
419
420EFL_START_TEST(elm_entry_magnifier)
421{
422 Evas_Object *win, *entry;
423 char buf[4096];
424
425 win = win_add_focused(NULL, "entry", ELM_WIN_BASIC);
426 evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
427
428 entry = elm_entry_add(win);
429 elm_entry_line_wrap_set(entry, ELM_WRAP_NONE);
430 snprintf(buf, sizeof(buf),
431 "This is an entry widget in this window that<br/>"
432 "uses markup <b>like this</> for styling and<br/>"
433 "formatting <em>like this</>, as well as<br/>"
434 "<a href=X><link>links in the text</></a>, so enter text<br/>"
435 "in here to edit it. By the way, links are<br/>"
436 "called <a href=anc-02>Anchors</a> so you will need<br/>"
437 "to refer to them this way.<br/>"
438 "<br/>"
439
440 "Also you can stick in items with (relsize + ascent): "
441 "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
442 " (full) "
443 "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
444 " (to the left)<br/>"
445
446 "Also (size + ascent): "
447 "<item size=16x16 vsize=ascent href=emoticon/haha></item>"
448 " (full) "
449 "<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
450 " (before this)<br/>"
451
452 "And as well (absize + ascent): "
453 "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
454 " (full) "
455 "<item absize=64x64 vsize=full href=emoticon/not-impressed></item>"
456 " or even paths to image files on disk too like: "
457 "<item absize=96x128 vsize=full href=file://%s/images/sky_01.jpg></item>"
458 " ... end."
459 , elm_app_data_dir_get()
460 );
461 elm_object_text_set(entry, buf);
462 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
463 evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
464 evas_object_show(entry);
465 elm_win_resize_object_add(win, entry);
466 evas_object_show(win);
467 evas_object_resize(entry, 600, 400);
468 evas_object_resize(win, 600, 400);
469 evas_smart_objects_calculate(evas_object_evas_get(win));
470 evas_event_callback_add(evas_object_evas_get(win), EVAS_CALLBACK_RENDER_POST, norendered, NULL);
471 ecore_main_loop_begin();
472}
473EFL_END_TEST
474
396EFL_START_TEST(elm_entry_text_set) 475EFL_START_TEST(elm_entry_text_set)
397{ 476{
398 Evas_Object *win, *entry; 477 Evas_Object *win, *entry;
@@ -427,4 +506,5 @@ void elm_test_entry(TCase *tc)
427 tcase_add_test(tc, elm_entry_atspi_text_selections); 506 tcase_add_test(tc, elm_entry_atspi_text_selections);
428 tcase_add_test(tc, elm_atspi_role_get); 507 tcase_add_test(tc, elm_atspi_role_get);
429 tcase_add_test(tc, elm_entry_text_set); 508 tcase_add_test(tc, elm_entry_text_set);
509 tcase_add_test(tc, elm_entry_magnifier);
430} 510}