Fix for utc_blink_ewk_view_orientation_send.TEST_0DG test.
authorLukasz Krok <l.krok@samsung.com>
Mon, 9 Feb 2015 16:39:43 +0000 (17:39 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
If this test is run as first in a test suit,
the orientation will already be 0 degrees (default),
so the orientation change event won't fire
and the test will fail. Setting orientation to other
value before checking ewk_view_orientation_send()
method with 0 as argument resolves the problem.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=9541
Reviewed by: DONGJUN KiM, Filip Piechocki, Kamil Klimek

Change-Id: I4e5b96c0b17ec6589aebcd8dca5ea8f3ee9e9477
Signed-off-by: Lukasz Krok <l.krok@samsung.com>
tizen_src/ewk/unittest/utc_blink_ewk_view_orientation_send_func.cpp

index 175db89..e22dbcb 100755 (executable)
@@ -11,7 +11,7 @@ class utc_blink_ewk_view_orientation_send : public utc_blink_ewk_base
 protected:
   utc_blink_ewk_view_orientation_send()
     : utc_blink_ewk_base()
-    , g_orientation(-1)
+    , g_orientation(0)
   {
   }
 
@@ -89,6 +89,14 @@ TEST_F(utc_blink_ewk_view_orientation_send, TEST_0DG)
   ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), full_path.c_str()));
   ASSERT_EQ(Success, EventLoopStart());
 
+  // 0 is default value, so we need to change it before
+  // checking ewk_view_orientation_send with 0 as argument
+  if (g_orientation == 0) {
+    ewk_view_orientation_send(GetEwkWebView(), 90);
+
+    ASSERT_EQ(Success, EventLoopStart());
+    ASSERT_EQ(g_orientation, 90);
+  }
   utc_message("[utc_blink_ewk_view_orientation_send TEST_0DG] :: ewk_view_orientation_send");
   ewk_view_orientation_send(GetEwkWebView(), 0);