Merge "DALi Version 2.1.10" into devel/master
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor / utc-Dali-Window.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include <dali-test-suite-utils.h>
19 #include <dali/dali.h>
20 #include <dali/devel-api/adaptor-framework/window-devel.h>
21 #include <dali/internal/system/linux/dali-ecore-x.h>
22
23 using namespace Dali;
24
25 void utc_dali_window_startup(void)
26 {
27   test_return_value = TET_UNDEF;
28 }
29
30 void utc_dali_window_cleanup(void)
31 {
32   test_return_value = TET_PASS;
33 }
34
35 namespace
36 {
37 intptr_t screenId = 0; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_x_default_screen_get below without compilation warnings
38
39 } // unnamed namespace
40
41 extern "C"
42 {
43   Ecore_X_Screen* ecore_x_default_screen_get(void)
44   {
45     screenId += 8;
46     return (Ecore_X_Screen*)screenId;
47   }
48
49   void ecore_x_screen_size_get(const Ecore_X_Screen* screen, int* w, int* h)
50   {
51     *w = 100;
52     *h = 100;
53   }
54
55   Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
56   {
57     return 0;
58   }
59 }
60
61 int UtcDaliWindowConstructorP(void)
62 {
63   Dali::Window window;
64   DALI_TEST_CHECK(!window);
65   END_TEST;
66 }
67
68 int UtcDaliWindowCopyConstructorP(void)
69 {
70   Dali::Window window;
71   Dali::Window copy(window);
72   DALI_TEST_CHECK(copy == window);
73
74   END_TEST;
75 }
76
77 int UtcDaliWindowConstructorFromInternalPointerN(void)
78 {
79   Internal::Adaptor::Window* internalWindow = NULL;
80   Dali::Window               window(internalWindow);
81   DALI_TEST_CHECK(!window); // Should not reach here!
82
83   END_TEST;
84 }
85
86 int UtcDaliWindowAssignmentOperatorP(void)
87 {
88   const Dali::Window window;
89   Dali::Window       copy;
90   DALI_TEST_CHECK(!copy);
91   copy = window;
92   DALI_TEST_CHECK(copy == window);
93
94   END_TEST;
95 }
96
97 int UtcDaliWindowDestructorP(void)
98 {
99   Dali::Window* window = new Dali::Window();
100   delete window;
101
102   DALI_TEST_CHECK(true);
103   END_TEST;
104 }
105
106 int UtcDaliWindowNewN(void)
107 {
108   // Attempt to create a new window
109   try
110   {
111     PositionSize windowPosition(0, 0, 0, 0);
112     Dali::Window window = Dali::Window::New(windowPosition, "test-window", true);
113
114     tet_result(TET_FAIL);
115   }
116   catch(DaliException& e)
117   {
118     DALI_TEST_ASSERT(e, "Failed to create X window", TEST_LOCATION);
119   }
120
121   // Attempt to create a new window
122   try
123   {
124     PositionSize windowPosition(0, 0, 0, 0);
125     Dali::Window window = Dali::Window::New(windowPosition, "test-window", "test-window-class", true);
126
127     tet_result(TET_FAIL);
128   }
129   catch(DaliException& e)
130   {
131     DALI_TEST_ASSERT(e, "Failed to create X window", TEST_LOCATION);
132   }
133
134   END_TEST;
135 }
136
137 int UtcDaliWindowSetClassN(void)
138 {
139   Dali::Window window;
140   try
141   {
142     window.SetClass("window-name", "window-class");
143     DALI_TEST_CHECK(false); // Should not reach here!
144   }
145   catch(...)
146   {
147     DALI_TEST_CHECK(true);
148   }
149
150   END_TEST;
151 }
152
153 int UtcDaliWindowRaiseN(void)
154 {
155   Dali::Window window;
156   try
157   {
158     window.Raise();
159     DALI_TEST_CHECK(false); // Should not reach here!
160   }
161   catch(...)
162   {
163     DALI_TEST_CHECK(true);
164   }
165
166   END_TEST;
167 }
168
169 int UtcDaliWindowLowerN(void)
170 {
171   Dali::Window window;
172   try
173   {
174     window.Lower();
175     DALI_TEST_CHECK(false); // Should not reach here!
176   }
177   catch(...)
178   {
179     DALI_TEST_CHECK(true);
180   }
181
182   END_TEST;
183 }
184
185 int UtcDaliWindowActivateN(void)
186 {
187   Dali::Window window;
188   try
189   {
190     window.Activate();
191     DALI_TEST_CHECK(false); // Should not reach here!
192   }
193   catch(...)
194   {
195     DALI_TEST_CHECK(true);
196   }
197
198   END_TEST;
199 }
200
201 int UtcDaliWindowMaximizeN(void)
202 {
203   try
204   {
205     Dali::Window    instance;
206     DevelWindow::Maximize(instance, true);
207     DALI_TEST_CHECK(false); // Should not reach here!
208   }
209   catch(...)
210   {
211     DALI_TEST_CHECK(true);
212   }
213
214   END_TEST;
215 }
216
217 int UtcDaliWindowIsMaximizedN(void)
218 {
219   try
220   {
221     Dali::Window    instance;
222     DevelWindow::IsMaximized(instance);
223     DALI_TEST_CHECK(false); // Should not reach here!
224   }
225   catch(...)
226   {
227     DALI_TEST_CHECK(true);
228   }
229
230   END_TEST;
231 }
232
233 int UtcDaliWindowMinimizeN(void)
234 {
235   try
236   {
237     Dali::Window    instance;
238     DevelWindow::Minimize(instance, true);
239     DALI_TEST_CHECK(false); // Should not reach here!
240   }
241   catch(...)
242   {
243     DALI_TEST_CHECK(true);
244   }
245
246   END_TEST;
247 }
248
249 int UtcDaliWindowIsMinimizedN(void)
250 {
251   try
252   {
253     Dali::Window    instance;
254     DevelWindow::IsMinimized(instance);
255     DALI_TEST_CHECK(false); // Should not reach here!
256   }
257   catch(...)
258   {
259     DALI_TEST_CHECK(true);
260   }
261
262   END_TEST;
263 }
264
265 int UtcDaliWindowAddAvailableOrientationN(void)
266 {
267   Dali::Window window;
268   try
269   {
270     window.AddAvailableOrientation(Dali::WindowOrientation::PORTRAIT);
271     DALI_TEST_CHECK(false); // Should not reach here!
272   }
273   catch(...)
274   {
275     DALI_TEST_CHECK(true);
276   }
277
278   END_TEST;
279 }
280
281 int UtcDaliWindowRemoveAvailableOrientationN(void)
282 {
283   Dali::Window window;
284   try
285   {
286     window.RemoveAvailableOrientation(Dali::WindowOrientation::PORTRAIT);
287     DALI_TEST_CHECK(false); // Should not reach here!
288   }
289   catch(...)
290   {
291     DALI_TEST_CHECK(true);
292   }
293
294   END_TEST;
295 }
296
297 int UtcDaliWindowSetPreferredOrientationN(void)
298 {
299   Dali::Window window;
300   try
301   {
302     window.SetPreferredOrientation(Dali::WindowOrientation::PORTRAIT);
303     DALI_TEST_CHECK(false); // Should not reach here!
304   }
305   catch(...)
306   {
307     DALI_TEST_CHECK(true);
308   }
309
310   END_TEST;
311 }
312
313 int UtcDaliWindowGetPreferredOrientationN(void)
314 {
315   Dali::Window window;
316   try
317   {
318     Dali::WindowOrientation orientation = window.GetPreferredOrientation();
319     DALI_TEST_CHECK(orientation == Dali::WindowOrientation::PORTRAIT); // Should not reach here!
320   }
321   catch(...)
322   {
323     DALI_TEST_CHECK(true);
324   }
325
326   END_TEST;
327 }
328
329 int UtcDaliWindowSetPositionSizeWithOrientationN(void)
330 {
331   Dali::Window window;
332   try
333   {
334     DevelWindow::SetPositionSizeWithOrientation(window, PositionSize(0, 0, 200, 100), Dali::WindowOrientation::PORTRAIT);
335     DALI_TEST_CHECK(false); // Should not reach here!
336   }
337   catch(...)
338   {
339     DALI_TEST_CHECK(true);
340   }
341
342   END_TEST;
343 }
344
345 int UtcDaliWindowGetNativeHandleN(void)
346 {
347   Dali::Window window;
348   try
349   {
350     Dali::Any handle = window.GetNativeHandle();
351     DALI_TEST_CHECK(false); // Should not reach here!
352   }
353   catch(...)
354   {
355     DALI_TEST_CHECK(true);
356   }
357
358   END_TEST;
359 }
360
361 int UtcDaliWindowSetAcceptFocusN(void)
362 {
363   Dali::Window window;
364   try
365   {
366     window.SetAcceptFocus(true);
367     DALI_TEST_CHECK(false); // Should not reach here!
368   }
369   catch(...)
370   {
371     DALI_TEST_CHECK(true);
372   }
373
374   END_TEST;
375 }
376
377 int UtcDaliWindowIsFocusAcceptableN(void)
378 {
379   Dali::Window window;
380   try
381   {
382     window.IsFocusAcceptable();
383     DALI_TEST_CHECK(false); // Should not reach here!
384   }
385   catch(...)
386   {
387     DALI_TEST_CHECK(true);
388   }
389
390   END_TEST;
391 }
392
393 int UtcDaliWindowFocusChangeSignalN(void)
394 {
395   Dali::Window window;
396   try
397   {
398     window.FocusChangeSignal();
399     DALI_TEST_CHECK(false); // Should not reach here!
400   }
401   catch(...)
402   {
403     DALI_TEST_CHECK(true);
404   }
405
406   END_TEST;
407 }
408
409 int UtcDaliWindowSetPositionNegative(void)
410 {
411   Dali::Window instance;
412   try
413   {
414     Dali::Uint16Pair arg1;
415     instance.SetPosition(arg1);
416     DALI_TEST_CHECK(false); // Should not get here
417   }
418   catch(...)
419   {
420     DALI_TEST_CHECK(true); // We expect an assert
421   }
422   END_TEST;
423 }
424
425 int UtcDaliWindowResizeSignalNegative(void)
426 {
427   Dali::Window instance;
428   try
429   {
430     instance.ResizeSignal();
431     DALI_TEST_CHECK(false); // Should not get here
432   }
433   catch(...)
434   {
435     DALI_TEST_CHECK(true); // We expect an assert
436   }
437   END_TEST;
438 }
439
440 int UtcDaliWindowSetBrightnessNegative(void)
441 {
442   Dali::Window instance;
443   try
444   {
445     int arg1(0);
446     instance.SetBrightness(arg1);
447     DALI_TEST_CHECK(false); // Should not get here
448   }
449   catch(...)
450   {
451     DALI_TEST_CHECK(true); // We expect an assert
452   }
453   END_TEST;
454 }
455
456 int UtcDaliWindowTouchedSignalNegative(void)
457 {
458   Dali::Window instance;
459   try
460   {
461     instance.TouchedSignal();
462     DALI_TEST_CHECK(false); // Should not get here
463   }
464   catch(...)
465   {
466     DALI_TEST_CHECK(true); // We expect an assert
467   }
468   END_TEST;
469 }
470
471 int UtcDaliWindowKeyEventSignalNegative(void)
472 {
473   Dali::Window instance;
474   try
475   {
476     instance.KeyEventSignal();
477     DALI_TEST_CHECK(false); // Should not get here
478   }
479   catch(...)
480   {
481     DALI_TEST_CHECK(true); // We expect an assert
482   }
483   END_TEST;
484 }
485
486 int UtcDaliWindowSetAcceptFocusNegative(void)
487 {
488   Dali::Window instance;
489   try
490   {
491     bool arg1(false);
492     instance.SetAcceptFocus(arg1);
493     DALI_TEST_CHECK(false); // Should not get here
494   }
495   catch(...)
496   {
497     DALI_TEST_CHECK(true); // We expect an assert
498   }
499   END_TEST;
500 }
501
502 int UtcDaliWindowSetInputRegionNegative(void)
503 {
504   Dali::Window instance;
505   try
506   {
507     Dali::Rect<int> arg1;
508     instance.SetInputRegion(arg1);
509     DALI_TEST_CHECK(false); // Should not get here
510   }
511   catch(...)
512   {
513     DALI_TEST_CHECK(true); // We expect an assert
514   }
515   END_TEST;
516 }
517
518 int UtcDaliWindowSetOpaqueStateNegative(void)
519 {
520   Dali::Window instance;
521   try
522   {
523     bool arg1(false);
524     instance.SetOpaqueState(arg1);
525     DALI_TEST_CHECK(false); // Should not get here
526   }
527   catch(...)
528   {
529     DALI_TEST_CHECK(true); // We expect an assert
530   }
531   END_TEST;
532 }
533
534 int UtcDaliWindowSetTransparencyNegative(void)
535 {
536   Dali::Window instance;
537   try
538   {
539     bool arg1(false);
540     instance.SetTransparency(arg1);
541     DALI_TEST_CHECK(false); // Should not get here
542   }
543   catch(...)
544   {
545     DALI_TEST_CHECK(true); // We expect an assert
546   }
547   END_TEST;
548 }
549
550 int UtcDaliWindowAddAuxiliaryHintNegative(void)
551 {
552   Dali::Window instance;
553   try
554   {
555     std::string arg1;
556     std::string arg2;
557     instance.AddAuxiliaryHint(arg1, arg2);
558     DALI_TEST_CHECK(false); // Should not get here
559   }
560   catch(...)
561   {
562     DALI_TEST_CHECK(true); // We expect an assert
563   }
564   END_TEST;
565 }
566
567 int UtcDaliWindowSetScreenOffModeNegative(void)
568 {
569   Dali::Window instance;
570   try
571   {
572     Dali::WindowScreenOffMode arg1(Dali::WindowScreenOffMode::NEVER);
573     instance.SetScreenOffMode(arg1);
574     DALI_TEST_CHECK(false); // Should not get here
575   }
576   catch(...)
577   {
578     DALI_TEST_CHECK(true); // We expect an assert
579   }
580   END_TEST;
581 }
582
583 int UtcDaliWindowFocusChangeSignalNegative(void)
584 {
585   Dali::Window instance;
586   try
587   {
588     instance.FocusChangeSignal();
589     DALI_TEST_CHECK(false); // Should not get here
590   }
591   catch(...)
592   {
593     DALI_TEST_CHECK(true); // We expect an assert
594   }
595   END_TEST;
596 }
597
598 int UtcDaliWindowGetRenderTaskListNegative(void)
599 {
600   Dali::Window instance;
601   try
602   {
603     instance.GetRenderTaskList();
604     DALI_TEST_CHECK(false); // Should not get here
605   }
606   catch(...)
607   {
608     DALI_TEST_CHECK(true); // We expect an assert
609   }
610   END_TEST;
611 }
612
613 int UtcDaliWindowSetBackgroundColorNegative(void)
614 {
615   Dali::Window instance;
616   try
617   {
618     Dali::Vector4 arg1;
619     instance.SetBackgroundColor(arg1);
620     DALI_TEST_CHECK(false); // Should not get here
621   }
622   catch(...)
623   {
624     DALI_TEST_CHECK(true); // We expect an assert
625   }
626   END_TEST;
627 }
628
629 int UtcDaliWindowRemoveAuxiliaryHintNegative(void)
630 {
631   Dali::Window instance;
632   try
633   {
634     unsigned int arg1(0u);
635     instance.RemoveAuxiliaryHint(arg1);
636     DALI_TEST_CHECK(false); // Should not get here
637   }
638   catch(...)
639   {
640     DALI_TEST_CHECK(true); // We expect an assert
641   }
642   END_TEST;
643 }
644
645 int UtcDaliWindowSetNotificationLevelNegative(void)
646 {
647   Dali::Window instance;
648   try
649   {
650     Dali::WindowNotificationLevel arg1(Dali::WindowNotificationLevel::NONE);
651     instance.SetNotificationLevel(arg1);
652     DALI_TEST_CHECK(false); // Should not get here
653   }
654   catch(...)
655   {
656     DALI_TEST_CHECK(true); // We expect an assert
657   }
658   END_TEST;
659 }
660
661 int UtcDaliWindowSetAuxiliaryHintValueNegative(void)
662 {
663   Dali::Window instance;
664   try
665   {
666     unsigned int arg1(0u);
667     std::string  arg2;
668     instance.SetAuxiliaryHintValue(arg1, arg2);
669     DALI_TEST_CHECK(false); // Should not get here
670   }
671   catch(...)
672   {
673     DALI_TEST_CHECK(true); // We expect an assert
674   }
675   END_TEST;
676 }
677
678 int UtcDaliWindowAddAvailableOrientationNegative(void)
679 {
680   Dali::Window instance;
681   try
682   {
683     Dali::WindowOrientation arg1(Dali::WindowOrientation::PORTRAIT);
684     instance.AddAvailableOrientation(arg1);
685     DALI_TEST_CHECK(false); // Should not get here
686   }
687   catch(...)
688   {
689     DALI_TEST_CHECK(true); // We expect an assert
690   }
691   END_TEST;
692 }
693
694 int UtcDaliWindowGetPreferredOrientationNegative(void)
695 {
696   Dali::Window instance;
697   try
698   {
699     instance.GetPreferredOrientation();
700     DALI_TEST_CHECK(false); // Should not get here
701   }
702   catch(...)
703   {
704     DALI_TEST_CHECK(true); // We expect an assert
705   }
706   END_TEST;
707 }
708
709 int UtcDaliWindowSetPreferredOrientationNegative(void)
710 {
711   Dali::Window instance;
712   try
713   {
714     Dali::WindowOrientation arg1(Dali::WindowOrientation::PORTRAIT);
715     instance.SetPreferredOrientation(arg1);
716     DALI_TEST_CHECK(false); // Should not get here
717   }
718   catch(...)
719   {
720     DALI_TEST_CHECK(true); // We expect an assert
721   }
722   END_TEST;
723 }
724
725 int UtcDaliWindowRemoveAvailableOrientationNegative(void)
726 {
727   Dali::Window instance;
728   try
729   {
730     Dali::WindowOrientation arg1(Dali::WindowOrientation::PORTRAIT);
731     instance.RemoveAvailableOrientation(arg1);
732     DALI_TEST_CHECK(false); // Should not get here
733   }
734   catch(...)
735   {
736     DALI_TEST_CHECK(true); // We expect an assert
737   }
738   END_TEST;
739 }
740
741 int UtcDaliWindowAddNegative(void)
742 {
743   Dali::Window instance;
744   try
745   {
746     Dali::Actor arg1;
747     instance.Add(arg1);
748     DALI_TEST_CHECK(false); // Should not get here
749   }
750   catch(...)
751   {
752     DALI_TEST_CHECK(true); // We expect an assert
753   }
754   END_TEST;
755 }
756
757 int UtcDaliWindowHideNegative(void)
758 {
759   Dali::Window instance;
760   try
761   {
762     instance.Hide();
763     DALI_TEST_CHECK(false); // Should not get here
764   }
765   catch(...)
766   {
767     DALI_TEST_CHECK(true); // We expect an assert
768   }
769   END_TEST;
770 }
771
772 int UtcDaliWindowShowNegative(void)
773 {
774   Dali::Window instance;
775   try
776   {
777     instance.Show();
778     DALI_TEST_CHECK(false); // Should not get here
779   }
780   catch(...)
781   {
782     DALI_TEST_CHECK(true); // We expect an assert
783   }
784   END_TEST;
785 }
786
787 int UtcDaliWindowLowerNegative(void)
788 {
789   Dali::Window instance;
790   try
791   {
792     instance.Lower();
793     DALI_TEST_CHECK(false); // Should not get here
794   }
795   catch(...)
796   {
797     DALI_TEST_CHECK(true); // We expect an assert
798   }
799   END_TEST;
800 }
801
802 int UtcDaliWindowRaiseNegative(void)
803 {
804   Dali::Window instance;
805   try
806   {
807     instance.Raise();
808     DALI_TEST_CHECK(false); // Should not get here
809   }
810   catch(...)
811   {
812     DALI_TEST_CHECK(true); // We expect an assert
813   }
814   END_TEST;
815 }
816
817 int UtcDaliWindowRemoveNegative(void)
818 {
819   Dali::Window instance;
820   try
821   {
822     Dali::Actor arg1;
823     instance.Remove(arg1);
824     DALI_TEST_CHECK(false); // Should not get here
825   }
826   catch(...)
827   {
828     DALI_TEST_CHECK(true); // We expect an assert
829   }
830   END_TEST;
831 }
832
833 int UtcDaliWindowSetSizeNegative(void)
834 {
835   Dali::Window instance;
836   try
837   {
838     Dali::Uint16Pair arg1;
839     instance.SetSize(arg1);
840     DALI_TEST_CHECK(false); // Should not get here
841   }
842   catch(...)
843   {
844     DALI_TEST_CHECK(true); // We expect an assert
845   }
846   END_TEST;
847 }
848
849 int UtcDaliWindowSetTypeNegative(void)
850 {
851   Dali::Window instance;
852   try
853   {
854     Dali::WindowType arg1(Dali::WindowType::NORMAL);
855     instance.SetType(arg1);
856     DALI_TEST_CHECK(false); // Should not get here
857   }
858   catch(...)
859   {
860     DALI_TEST_CHECK(true); // We expect an assert
861   }
862   END_TEST;
863 }
864
865 int UtcDaliWindowActivateNegative(void)
866 {
867   Dali::Window instance;
868   try
869   {
870     instance.Activate();
871     DALI_TEST_CHECK(false); // Should not get here
872   }
873   catch(...)
874   {
875     DALI_TEST_CHECK(true); // We expect an assert
876   }
877   END_TEST;
878 }
879
880 int UtcDaliWindowSetClassNegative(void)
881 {
882   Dali::Window instance;
883   try
884   {
885     std::string arg1;
886     std::string arg2;
887     instance.SetClass(arg1, arg2);
888     DALI_TEST_CHECK(false); // Should not get here
889   }
890   catch(...)
891   {
892     DALI_TEST_CHECK(true); // We expect an assert
893   }
894   END_TEST;
895 }
896
897 int UtcDaliWindowGetPositionNegative(void)
898 {
899   Dali::Window instance;
900   try
901   {
902     instance.GetPosition();
903     DALI_TEST_CHECK(false); // Should not get here
904   }
905   catch(...)
906   {
907     DALI_TEST_CHECK(true); // We expect an assert
908   }
909   END_TEST;
910 }
911
912 int UtcDaliWindowGetRootLayerNegative(void)
913 {
914   Dali::Window instance;
915   try
916   {
917     instance.GetRootLayer();
918     DALI_TEST_CHECK(false); // Should not get here
919   }
920   catch(...)
921   {
922     DALI_TEST_CHECK(true); // We expect an assert
923   }
924   END_TEST;
925 }
926
927 int UtcDaliWindowGetBrightnessNegative(void)
928 {
929   Dali::Window instance;
930   try
931   {
932     instance.GetBrightness();
933     DALI_TEST_CHECK(false); // Should not get here
934   }
935   catch(...)
936   {
937     DALI_TEST_CHECK(true); // We expect an assert
938   }
939   END_TEST;
940 }
941
942 int UtcDaliWindowGetLayerCountNegative(void)
943 {
944   Dali::Window instance;
945   try
946   {
947     instance.GetLayerCount();
948     DALI_TEST_CHECK(false); // Should not get here
949   }
950   catch(...)
951   {
952     DALI_TEST_CHECK(true); // We expect an assert
953   }
954   END_TEST;
955 }
956
957 int UtcDaliWindowIsOpaqueStateNegative(void)
958 {
959   Dali::Window instance;
960   try
961   {
962     instance.IsOpaqueState();
963     DALI_TEST_CHECK(false); // Should not get here
964   }
965   catch(...)
966   {
967     DALI_TEST_CHECK(true); // We expect an assert
968   }
969   END_TEST;
970 }
971
972 int UtcDaliWindowGetNativeHandleNegative(void)
973 {
974   Dali::Window instance;
975   try
976   {
977     instance.GetNativeHandle();
978     DALI_TEST_CHECK(false); // Should not get here
979   }
980   catch(...)
981   {
982     DALI_TEST_CHECK(true); // We expect an assert
983   }
984   END_TEST;
985 }
986
987 int UtcDaliWindowGetScreenOffModeNegative(void)
988 {
989   Dali::Window instance;
990   try
991   {
992     instance.GetScreenOffMode();
993     DALI_TEST_CHECK(false); // Should not get here
994   }
995   catch(...)
996   {
997     DALI_TEST_CHECK(true); // We expect an assert
998   }
999   END_TEST;
1000 }
1001
1002 int UtcDaliWindowIsFocusAcceptableNegative(void)
1003 {
1004   Dali::Window instance;
1005   try
1006   {
1007     instance.IsFocusAcceptable();
1008     DALI_TEST_CHECK(false); // Should not get here
1009   }
1010   catch(...)
1011   {
1012     DALI_TEST_CHECK(true); // We expect an assert
1013   }
1014   END_TEST;
1015 }
1016
1017 int UtcDaliWindowGetAuxiliaryHintIdNegative(void)
1018 {
1019   Dali::Window instance;
1020   try
1021   {
1022     std::string arg1;
1023     instance.GetAuxiliaryHintId(arg1);
1024     DALI_TEST_CHECK(false); // Should not get here
1025   }
1026   catch(...)
1027   {
1028     DALI_TEST_CHECK(true); // We expect an assert
1029   }
1030   END_TEST;
1031 }
1032
1033 int UtcDaliWindowGetBackgroundColorNegative(void)
1034 {
1035   Dali::Window instance;
1036   try
1037   {
1038     instance.GetBackgroundColor();
1039     DALI_TEST_CHECK(false); // Should not get here
1040   }
1041   catch(...)
1042   {
1043     DALI_TEST_CHECK(true); // We expect an assert
1044   }
1045   END_TEST;
1046 }
1047
1048 int UtcDaliWindowGetNotificationLevelNegative(void)
1049 {
1050   Dali::Window instance;
1051   try
1052   {
1053     instance.GetNotificationLevel();
1054     DALI_TEST_CHECK(false); // Should not get here
1055   }
1056   catch(...)
1057   {
1058     DALI_TEST_CHECK(true); // We expect an assert
1059   }
1060   END_TEST;
1061 }
1062
1063 int UtcDaliWindowGetAuxiliaryHintValueNegative(void)
1064 {
1065   Dali::Window instance;
1066   try
1067   {
1068     unsigned int arg1(0u);
1069     instance.GetAuxiliaryHintValue(arg1);
1070     DALI_TEST_CHECK(false); // Should not get here
1071   }
1072   catch(...)
1073   {
1074     DALI_TEST_CHECK(true); // We expect an assert
1075   }
1076   END_TEST;
1077 }
1078
1079 int UtcDaliWindowGetSupportedAuxiliaryHintNegative(void)
1080 {
1081   Dali::Window instance;
1082   try
1083   {
1084     unsigned int arg1(0u);
1085     instance.GetSupportedAuxiliaryHint(arg1);
1086     DALI_TEST_CHECK(false); // Should not get here
1087   }
1088   catch(...)
1089   {
1090     DALI_TEST_CHECK(true); // We expect an assert
1091   }
1092   END_TEST;
1093 }
1094
1095 int UtcDaliWindowGetSupportedAuxiliaryHintCountNegative(void)
1096 {
1097   Dali::Window instance;
1098   try
1099   {
1100     instance.GetSupportedAuxiliaryHintCount();
1101     DALI_TEST_CHECK(false); // Should not get here
1102   }
1103   catch(...)
1104   {
1105     DALI_TEST_CHECK(true); // We expect an assert
1106   }
1107   END_TEST;
1108 }
1109
1110 int UtcDaliWindowGetDpiNegative(void)
1111 {
1112   Dali::Window instance;
1113   try
1114   {
1115     instance.GetDpi();
1116     DALI_TEST_CHECK(false); // Should not get here
1117   }
1118   catch(...)
1119   {
1120     DALI_TEST_CHECK(true); // We expect an assert
1121   }
1122   END_TEST;
1123 }
1124
1125 int UtcDaliWindowGetSizeNegative(void)
1126 {
1127   Dali::Window instance;
1128   try
1129   {
1130     instance.GetSize();
1131     DALI_TEST_CHECK(false); // Should not get here
1132   }
1133   catch(...)
1134   {
1135     DALI_TEST_CHECK(true); // We expect an assert
1136   }
1137   END_TEST;
1138 }
1139
1140 int UtcDaliWindowGetTypeNegative(void)
1141 {
1142   Dali::Window instance;
1143   try
1144   {
1145     instance.GetType();
1146     DALI_TEST_CHECK(false); // Should not get here
1147   }
1148   catch(...)
1149   {
1150     DALI_TEST_CHECK(true); // We expect an assert
1151   }
1152   END_TEST;
1153 }
1154
1155 int UtcDaliWindowGetLayerNegative(void)
1156 {
1157   Dali::Window instance;
1158   try
1159   {
1160     unsigned int arg1(0u);
1161     instance.GetLayer(arg1);
1162     DALI_TEST_CHECK(false); // Should not get here
1163   }
1164   catch(...)
1165   {
1166     DALI_TEST_CHECK(true); // We expect an assert
1167   }
1168   END_TEST;
1169 }
1170
1171 int UtcDaliWindowIsVisibleNegative(void)
1172 {
1173   Dali::Window instance;
1174   try
1175   {
1176     instance.IsVisible();
1177     DALI_TEST_CHECK(false); // Should not get here
1178   }
1179   catch(...)
1180   {
1181     DALI_TEST_CHECK(true); // We expect an assert
1182   }
1183   END_TEST;
1184 }
1185
1186 int UtcDaliWindowGetNativeIdNegative(void)
1187 {
1188   try
1189   {
1190     Dali::Window arg1;
1191     DevelWindow::GetNativeId(arg1);
1192     DALI_TEST_CHECK(false); // Should not get here
1193   }
1194   catch(...)
1195   {
1196     DALI_TEST_CHECK(true); // We expect an assert
1197   }
1198   END_TEST;
1199 }
1200
1201 int UtcDaliWindowSetPositionSizeNegative(void)
1202 {
1203   try
1204   {
1205     Dali::Window    arg1;
1206     Dali::Rect<int> arg2;
1207     DevelWindow::SetPositionSize(arg1, arg2);
1208     DALI_TEST_CHECK(false); // Should not get here
1209   }
1210   catch(...)
1211   {
1212     DALI_TEST_CHECK(true); // We expect an assert
1213   }
1214   END_TEST;
1215 }
1216
1217 int UtcDaliWindowWheelEventSignalNegative(void)
1218 {
1219   try
1220   {
1221     Dali::Window arg1;
1222     DevelWindow::WheelEventSignal(arg1);
1223     DALI_TEST_CHECK(false); // Should not get here
1224   }
1225   catch(...)
1226   {
1227     DALI_TEST_CHECK(true); // We expect an assert
1228   }
1229   END_TEST;
1230 }
1231
1232 int UtcDaliWindowGetCurrentOrientationNegative(void)
1233 {
1234   try
1235   {
1236     Dali::Window arg1;
1237     DevelWindow::GetCurrentOrientation(arg1);
1238     DALI_TEST_CHECK(false); // Should not get here
1239   }
1240   catch(...)
1241   {
1242     DALI_TEST_CHECK(true); // We expect an assert
1243   }
1244   END_TEST;
1245 }
1246
1247 int UtcDaliWindowGetPhysicalOrientationNegative(void)
1248 {
1249   try
1250   {
1251     Dali::Window arg1;
1252     DevelWindow::GetPhysicalOrientation(arg1);
1253     DALI_TEST_CHECK(false); // Should not get here
1254   }
1255   catch(...)
1256   {
1257     DALI_TEST_CHECK(true); // We expect an assert
1258   }
1259   END_TEST;
1260 }
1261
1262 int UtcDaliWindowVisibilityChangedSignalNegative(void)
1263 {
1264   try
1265   {
1266     Dali::Window arg1;
1267     DevelWindow::VisibilityChangedSignal(arg1);
1268     DALI_TEST_CHECK(false); // Should not get here
1269   }
1270   catch(...)
1271   {
1272     DALI_TEST_CHECK(true); // We expect an assert
1273   }
1274   END_TEST;
1275 }
1276
1277 int UtcDaliWindowAddFrameRenderedCallbackNegative(void)
1278 {
1279   try
1280   {
1281     Dali::Window                        arg1;
1282     std::unique_ptr<Dali::CallbackBase> arg2;
1283     int                                 arg3(0);
1284     DevelWindow::AddFrameRenderedCallback(arg1, std::move(arg2), arg3);
1285     DALI_TEST_CHECK(false); // Should not get here
1286   }
1287   catch(...)
1288   {
1289     DALI_TEST_CHECK(true); // We expect an assert
1290   }
1291   END_TEST;
1292 }
1293
1294 int UtcDaliWindowSetAvailableOrientationsNegative(void)
1295 {
1296   try
1297   {
1298     Dali::Window                          arg1;
1299     Dali::Vector<Dali::WindowOrientation> arg2;
1300     DevelWindow::SetAvailableOrientations(arg1, arg2);
1301     DALI_TEST_CHECK(false); // Should not get here
1302   }
1303   catch(...)
1304   {
1305     DALI_TEST_CHECK(true); // We expect an assert
1306   }
1307   END_TEST;
1308 }
1309
1310 int UtcDaliWindowAddFramePresentedCallbackNegative(void)
1311 {
1312   try
1313   {
1314     Dali::Window                        arg1;
1315     std::unique_ptr<Dali::CallbackBase> arg2;
1316     int                                 arg3(0);
1317     DevelWindow::AddFramePresentedCallback(arg1, std::move(arg2), arg3);
1318     DALI_TEST_CHECK(false); // Should not get here
1319   }
1320   catch(...)
1321   {
1322     DALI_TEST_CHECK(true); // We expect an assert
1323   }
1324   END_TEST;
1325 }
1326
1327 int UtcDaliWindowTransitionEffectEventSignalNegative(void)
1328 {
1329   try
1330   {
1331     Dali::Window arg1;
1332     DevelWindow::TransitionEffectEventSignal(arg1);
1333     DALI_TEST_CHECK(false); // Should not get here
1334   }
1335   catch(...)
1336   {
1337     DALI_TEST_CHECK(true); // We expect an assert
1338   }
1339   END_TEST;
1340 }
1341
1342 int UtcDaliWindowEventProcessingFinishedSignalNegative(void)
1343 {
1344   try
1345   {
1346     Dali::Window arg1;
1347     DevelWindow::EventProcessingFinishedSignal(arg1);
1348     DALI_TEST_CHECK(false); // Should not get here
1349   }
1350   catch(...)
1351   {
1352     DALI_TEST_CHECK(true); // We expect an assert
1353   }
1354   END_TEST;
1355 }
1356
1357 int UtcDaliWindowKeyboardRepeatSettingsChangedSignalNegative(void)
1358 {
1359   try
1360   {
1361     Dali::Window arg1;
1362     DevelWindow::KeyboardRepeatSettingsChangedSignal(arg1);
1363     DALI_TEST_CHECK(false); // Should not get here
1364   }
1365   catch(...)
1366   {
1367     DALI_TEST_CHECK(true); // We expect an assert
1368   }
1369   END_TEST;
1370 }
1371
1372 int UtcDaliWindowUnparentNegative(void)
1373 {
1374   try
1375   {
1376     Dali::Window arg1;
1377     DevelWindow::Unparent(arg1);
1378     DALI_TEST_CHECK(false); // Should not get here
1379   }
1380   catch(...)
1381   {
1382     DALI_TEST_CHECK(true); // We expect an assert
1383   }
1384   END_TEST;
1385 }
1386
1387 int UtcDaliWindowGetParentNegative(void)
1388 {
1389   try
1390   {
1391     Dali::Window arg1;
1392     DevelWindow::GetParent(arg1);
1393     DALI_TEST_CHECK(false); // Should not get here
1394   }
1395   catch(...)
1396   {
1397     DALI_TEST_CHECK(true); // We expect an assert
1398   }
1399   END_TEST;
1400 }
1401
1402 int UtcDaliWindowSetParentNegative(void)
1403 {
1404   try
1405   {
1406     Dali::Window arg1;
1407     Dali::Window arg2;
1408     DevelWindow::SetParent(arg1, arg2);
1409     DALI_TEST_CHECK(false); // Should not get here
1410   }
1411   catch(...)
1412   {
1413     DALI_TEST_CHECK(true); // We expect an assert
1414   }
1415   END_TEST;
1416 }
1417
1418 int UtcDaliWindowSetParentWithBelowParentNegative(void)
1419 {
1420   try
1421   {
1422     Dali::Window arg1;
1423     Dali::Window arg2;
1424     DevelWindow::SetParent(arg1, arg2, true);
1425     DALI_TEST_CHECK(false); // Should not get here
1426   }
1427   catch(...)
1428   {
1429     DALI_TEST_CHECK(true); // We expect an assert
1430   }
1431   END_TEST;
1432 }
1433
1434 int UtcDaliWindowAddInputRegion(void)
1435 {
1436   Dali::Window instance;
1437   try
1438   {
1439     Rect<int> includedInputRegion(0,0,720,640);
1440     DevelWindow::IncludeInputRegion(instance, includedInputRegion);
1441     DALI_TEST_CHECK(false); // Should not get here
1442   }
1443   catch(...)
1444   {
1445     DALI_TEST_CHECK(true); // We expect an assert
1446   }
1447   END_TEST;
1448 }
1449
1450 int UtcDaliWindowSubtractInputRegion(void)
1451 {
1452   Dali::Window instance;
1453   try
1454   {
1455     Rect<int> includedInputRegion(0,0,720,1280);
1456     DevelWindow::IncludeInputRegion(instance, includedInputRegion);
1457
1458     Rect<int> excludedInputRegion(0,641,720,640);
1459     DevelWindow::ExcludeInputRegion(instance, excludedInputRegion);
1460
1461     DALI_TEST_CHECK(false); // Should not get here
1462   }
1463   catch(...)
1464   {
1465     DALI_TEST_CHECK(true); // We expect an assert
1466   }
1467   END_TEST;
1468 }
1469
1470
1471 int UtcDaliWindowSetNeedsRotationCompletedAcknowledgementNegative(void)
1472 {
1473   try
1474   {
1475     Dali::Window arg1;
1476     DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, true);
1477     DALI_TEST_CHECK(false); // Should not get here
1478   }
1479   catch(...)
1480   {
1481     DALI_TEST_CHECK(true); // We expect an assert
1482   }
1483   END_TEST;
1484 }
1485
1486 int UtcDaliWindowUnsetNeedsRotationCompletedAcknowledgementNegative(void)
1487 {
1488   try
1489   {
1490     Dali::Window arg1;
1491     DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, false);
1492     DALI_TEST_CHECK(false); // Should not get here
1493   }
1494   catch(...)
1495   {
1496     DALI_TEST_CHECK(true); // We expect an assert
1497   }
1498   END_TEST;
1499 }
1500
1501 int UtcDaliWindowSendRotationCompletedAcknowledgementNegative(void)
1502 {
1503   try
1504   {
1505     Dali::Window arg1;
1506     DevelWindow::SendRotationCompletedAcknowledgement(arg1);
1507
1508     DALI_TEST_CHECK(false); // Should not get here
1509   }
1510   catch(...)
1511   {
1512     DALI_TEST_CHECK(true); // We expect an assert
1513   }
1514   END_TEST;
1515 }