<head>
<title>Orientation Test</title>
<script type="text/javascript">
- function onLoad() {
- window.addEventListener("orientationchange", updateOrientation);
- document.title=window.orientation;
- }
+ function onLoad() {
+ screen.orientation.addEventListener("change", updateOrientation);
+ document.title=screen.orientation.angle;
+ }
function updateOrientation()
{
- console.log(window.orientation);
+ console.log(screen.orientation.angle);
}
</script>
</head>
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:
}
/**
- * @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)
{
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.
*/
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
+}