From: Arnaud Renevier Date: Tue, 24 Nov 2015 00:37:19 +0000 (-0800) Subject: Fixes utc_blink_ewk_view_orientation_send_func unittest X-Git-Tag: submit/tizen/20190801.160004~1118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77c6495d9dba2b2f2dc1c3290839af81dd2f9380;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Fixes utc_blink_ewk_view_orientation_send_func unittest In order to fix utc_blink_ewk_view_orientation_send, we need to use the new screen orientation API instead of window orientation. Also, an orientation of -90 is transformed into a 270 orientation by ewk. So, we need to take that into account In addition, in order to make the test more thorough, we add a test to check that an invalid orientation value isn't propagated. Lastly, we remove the files orientation_test1.html, orientation_test2.html and orientation_test3.html which were unused. Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=6980 Reviewed by: a1.gomes, djmix.kim Change-Id: Iae76f08151a753272877d9839c3660842f0b161b Signed-off-by: Arnaud Renevier --- diff --git a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test.html b/tizen_src/ewk/unittest/resources/ewk_view/orientation_test.html index 8e077004723b..52807e590706 100755 --- a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test.html +++ b/tizen_src/ewk/unittest/resources/ewk_view/orientation_test.html @@ -2,14 +2,14 @@ Orientation Test diff --git a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test1.html b/tizen_src/ewk/unittest/resources/ewk_view/orientation_test1.html deleted file mode 100755 index 28fda0ea16f4..000000000000 --- a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test1.html +++ /dev/null @@ -1,15 +0,0 @@ - - - Orientation Test - - - -

Orientation Test Page

- - diff --git a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test2.html b/tizen_src/ewk/unittest/resources/ewk_view/orientation_test2.html deleted file mode 100755 index 940c8ea960c3..000000000000 --- a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test2.html +++ /dev/null @@ -1,15 +0,0 @@ - - - Orientation Test - - - -

Orientation Test Page

- - diff --git a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test3.html b/tizen_src/ewk/unittest/resources/ewk_view/orientation_test3.html deleted file mode 100755 index 28cd702262b3..000000000000 --- a/tizen_src/ewk/unittest/resources/ewk_view/orientation_test3.html +++ /dev/null @@ -1,15 +0,0 @@ - - - Orientation Test - - - -

Orientation Test Page

- - diff --git a/tizen_src/ewk/unittest/utc_blink_ewk_view_orientation_send_func.cpp b/tizen_src/ewk/unittest/utc_blink_ewk_view_orientation_send_func.cpp index e22dbcb22f3c..d50863f61d89 100755 --- a/tizen_src/ewk/unittest/utc_blink_ewk_view_orientation_send_func.cpp +++ b/tizen_src/ewk/unittest/utc_blink_ewk_view_orientation_send_func.cpp @@ -34,11 +34,15 @@ protected: case 0: case 90: case 180: + case 270: g_orientation = orientation; + EventLoopStop(utc_blink_ewk_base::Success); + break; + default: + EventLoopStop(utc_blink_ewk_base::Failure); break; } - EventLoopStop(utc_blink_ewk_base::Success); } protected: @@ -105,7 +109,24 @@ TEST_F(utc_blink_ewk_view_orientation_send, TEST_0DG) } /** - * @brief Checking whether orientation is set to -90 properly. + * @brief Checking whether orientation is set to 270 properly. + */ +TEST_F(utc_blink_ewk_view_orientation_send, TEST_270DG) +{ + std::string full_path = GetResourceUrl(URL); + ASSERT_FALSE(full_path.empty()); + ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), full_path.c_str())); + ASSERT_EQ(Success, EventLoopStart()); + + utc_message("[utc_blink_ewk_view_orientation_send TEST_270DG] :: ewk_view_orientation_send"); + ewk_view_orientation_send(GetEwkWebView(), 270); + + ASSERT_EQ(Success, EventLoopStart()); + ASSERT_EQ(g_orientation, 270); +} + +/** + * @brief Checking whether orientation of -90 is transformed to -270 properly. */ TEST_F(utc_blink_ewk_view_orientation_send, TEST_MINUS90DG) { @@ -118,9 +139,26 @@ TEST_F(utc_blink_ewk_view_orientation_send, TEST_MINUS90DG) ewk_view_orientation_send(GetEwkWebView(), -90); ASSERT_EQ(Success, EventLoopStart()); - ASSERT_EQ(g_orientation, -90); + ASSERT_EQ(g_orientation, 270); } +/** + * @brief Checking that invalid orientation is not set. + */ +TEST_F(utc_blink_ewk_view_orientation_send, TEST_40DG) +{ + std::string full_path = GetResourceUrl(URL); + ASSERT_FALSE(full_path.empty()); + ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), full_path.c_str())); + ASSERT_EQ(Success, EventLoopStart()); + + utc_message("[utc_blink_ewk_view_orientation_send TEST_40DG] :: ewk_view_orientation_send"); + ewk_view_orientation_send(GetEwkWebView(), 40); + + ASSERT_EQ(Timeout, EventLoopStart(2.0)); +} + + /** * @brief Checking whether function works properly in case of NULL of a webview. */ @@ -153,4 +191,4 @@ TEST_F(utc_blink_ewk_view_orientation_send, BEFOREURLSET) ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), full_path.c_str())); EXPECT_EQ(Success, EventLoopStart()); ASSERT_EQ(g_orientation, 90); -} \ No newline at end of file +}