This function should be used for browser edge scroll.
Scrolls webpage of view by dx and dy.
"edge,scroll,left"
"edge,scroll,top"
"edge,scroll,bottom"
"edge,scroll,right"
reference:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/279660/
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/280265/
Change-Id: Ifb4644e75467d1be2c6207c3b2462465303252b7
Signed-off-by: wangjing <jing124.wang@samsung.com>
// blink::mojom::WidgetHost implementation.
void SetCursor(const ui::Cursor& cursor) override;
+#if BUILDFLAG(IS_TIZEN_TV)
+ void DidEdgeScrollBy(const gfx::Point& point, bool handled) override {}
+#endif
void UpdateTooltipUnderCursor(const std::u16string& tooltip_text,
base::i18n::TextDirection hint) override;
void UpdateTooltipFromKeyboard(const std::u16string& tooltip_text,
std::move(callback).Run();
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void RenderWidgetHostImpl::DidEdgeScrollBy(const gfx::Point& offset, bool handled) {
+ if (!GetView())
+ return;
+
+ view_->DidEdgeScrollBy(offset, handled);
+}
+#endif
+
void RenderWidgetHostImpl::UpdateTooltipUnderCursor(
const std::u16string& tooltip_text,
base::i18n::TextDirection text_direction_hint) {
const ChildProcessTerminationInfo& info) override;
// blink::mojom::WidgetHost implementation.
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ void DidEdgeScrollBy(const gfx::Point& point, bool handled) override;
+#endif
void UpdateTooltipUnderCursor(
const std::u16string& tooltip_text,
base::i18n::TextDirection text_direction_hint) override;
#endif
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void RenderWidgetHostViewAura::DidEdgeScrollBy(const gfx::Point& offset,
+ bool handled) {
+ efl_helper_->DidEdgeScrollBy(offset, handled);
+}
+#endif
+
void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) {
event_handler_->OnScrollEvent(event);
}
#endif
) override;
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ void DidEdgeScrollBy(const gfx::Point& offset, bool handled) override ;
+#endif
void OnSynchronizedDisplayPropertiesChanged(bool rotation = false) override;
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) override;
// Tells the View to destroy itself.
virtual void Destroy();
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ virtual void DidEdgeScrollBy(const gfx::Point& offset, bool handled) {}
+#endif
+
// Calls UpdateTooltip if the view is under the cursor.
virtual void UpdateTooltipUnderCursor(const std::u16string& tooltip_text) {}
// Invoked when a primary main frame navigation occurs.
virtual void DidNavigatePrimaryMainFramePostCommit(WebContents* source) {}
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ virtual void DidEdgeScrollBy(const gfx::Point& offset, bool handled) {}
+#endif
+
// Returns a pointer to a service to manage JavaScript dialogs. May return
// nullptr in which case dialogs aren't shown.
virtual JavaScriptDialogManager* GetJavaScriptDialogManager(
enabled_features += [ "is_efl" ]
}
+ if (tizen_product_tv) {
+ enabled_features += [ "is_tizen_tv" ]
+ }
+
if (is_android) {
# Direct deps (instead of transitive deps) are necessary for java targets.
public_deps += [
// third_party/blink/public/mojom/frame/viewport_intersection_state.mojom
SetViewportIntersection(ViewportIntersectionState intersection_state,
VisualProperties? visual_properties);
+
+ [EnableIf=is_tizen_tv]
+ //Browser edge scroll
+ EdgeScrollBy(gfx.mojom.Point offset, gfx.mojom.Point mouse_position);
};
// Implemented in Browser, this interface defines frame-widget-specific methods that
// location of a pointing device.
SetCursor(ui.mojom.Cursor cursor);
+ [EnableIf=is_tizen_tv]
+ //Browser edge scroll
+ DidEdgeScrollBy(gfx.mojom.Point offset, bool handled);
+
// Sent by a widget to the browser to set the tooltip text for the current
// cursor position. An empty |tooltip_text| will hide the tooltip view.
UpdateTooltipUnderCursor(mojo_base.mojom.String16 tooltip_text,
#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/platform/web_common.h"
+#include "third_party/blink/renderer/core/scroll/scroll_types.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/display/mojom/screen_orientation.mojom-shared.h"
virtual bool IsVideoHoleForRender() const = 0;
#endif
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ virtual bool EdgeScrollBy(const ScrollOffset&, const gfx::Point&) = 0;
+#endif
+
// Misc -------------------------------------------------------------
// Returns the number of live WebView instances in this process.
return GetPage()->GetSettings().GetVideoHoleEnabled();
}
#endif
+
+#if BUILDFLAG(IS_TIZEN_TV)
+bool WebViewImpl::EdgeScrollBy(const ScrollOffset& scroll_offset,
+ const gfx::Point& mouse_point) {
+ if (!MainFrameImpl())
+ return false;
+ const LocalFrameView* view = MainFrameImpl()->GetFrameView();
+ if (!view)
+ return false;
+
+ LayoutView* const layout_view = view->GetLayoutView();
+ if (!layout_view)
+ return false;
+
+ const gfx::Point point(mouse_point);
+ HitTestLocation location(point);
+ const HitTestRequest request(HitTestRequest::kReadOnly |
+ HitTestRequest::kAllowChildFrameContent);
+ HitTestResult result(request, location);
+
+ layout_view->HitTest(location, result);
+
+ const LocalFrame* frame = result.InnerNodeFrame();
+ if (!frame) {
+ frame = DynamicTo<LocalFrame>(
+ page_->GetFocusController().FocusedOrMainFrame());
+ }
+
+ return frame->GetEventHandler().ScrollWithMultiplier(scroll_offset,
+ result.InnerNode());
+}
+#endif
+
} // namespace blink
bool IsVideoHoleForRender() const override;
#endif
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ bool EdgeScrollBy(const ScrollOffset&, const gfx::Point&) override;
+#endif
+
private:
FRIEND_TEST_ALL_PREFIXES(WebFrameTest, DivScrollIntoEditableTest);
FRIEND_TEST_ALL_PREFIXES(WebFrameTest,
visitor->Trace(device_emulator_);
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void WebFrameWidgetImpl::EdgeScrollBy(const gfx::Point& offset, const gfx::Point& mouse_position) {
+ bool handled = false;
+ WebViewImpl* webview = View();
+ if (webview)
+ handled = webview->EdgeScrollBy(
+ blink::ScrollOffset(offset.x(), offset.y()),
+ gfx::Point(mouse_position.x(), mouse_position.y()));
+ widget_base_->DidEdgeScrollBy(offset, handled);
+}
+#endif
+
void WebFrameWidgetImpl::SetNeedsRecalculateRasterScales() {
if (!View()->does_composite())
return;
GetStringAtPointCallback callback) override;
#endif
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ void EdgeScrollBy(const gfx::Point& offset, const gfx::Point& mouse_position) override;
+#endif
+
// mojom::blink::FrameWidgetInputHandler overrides.
void AddImeTextSpansToExistingText(
uint32_t start,
should_only_fire_drag_over_event_ = false;
}
+#if BUILDFLAG(IS_TIZEN_TV)
+bool EventHandler::ScrollNewPosition(const ScrollOffset& scroll_offset,
+ LocalFrameView* frame_view) {
+ ScrollableArea* const scrollable_area = frame_view->LayoutViewport();
+ if (!scrollable_area)
+ return false;
+
+ gfx::PointF ori_point = scrollable_area->ScrollPosition();
+ scrollable_area->ScrollBy(scroll_offset, mojom::blink::ScrollType::kUser);
+ gfx::PointF new_point = scrollable_area->ScrollPosition();
+ return new_point != ori_point;
+}
+
+bool EventHandler::ScrollWithMultiplier(const ScrollOffset& scroll_offset,
+ Node* start_node) {
+ LocalFrame* frame = frame_;
+ while (frame) {
+ mojom::blink::ScrollDirection vertical_direction =
+ (scroll_offset.y() < 0)
+ ? mojom::blink::ScrollDirection::kScrollUpIgnoringWritingMode
+ : mojom::blink::ScrollDirection::kScrollDownIgnoringWritingMode;
+ mojom::blink::ScrollDirection horizontal_direction =
+ (scroll_offset.x() < 0)
+ ? mojom::blink::ScrollDirection::kScrollLeftIgnoringWritingMode
+ : mojom::blink::ScrollDirection::kScrollRightIgnoringWritingMode;
+ if (scroll_manager_->LogicalScroll(
+ vertical_direction, ui::ScrollGranularity::kScrollByPixel, start_node,
+ nullptr, std::abs(scroll_offset.y())))
+ return true;
+
+ if (scroll_manager_->LogicalScroll(
+ horizontal_direction, ui::ScrollGranularity::kScrollByPixel, start_node,
+ nullptr, std::abs(scroll_offset.x())))
+ return true;
+
+ LocalFrameView* frame_view = frame->View();
+ if (frame_view && ScrollNewPosition(scroll_offset, frame_view))
+ return true;
+
+ frame = DynamicTo<LocalFrame>(frame->Tree().Parent());
+ if (frame)
+ start_node = frame->DeprecatedLocalOwner();
+ }
+ return false;
+}
+#endif
+
void EventHandler::AnimateSnapFling(base::TimeTicks monotonic_time) {
scroll_manager_->AnimateSnapFling(monotonic_time);
}
// canceled.
void ClearDragState();
+#if BUILDFLAG(IS_TIZEN_TV)
+ bool ScrollNewPosition(const ScrollOffset&, LocalFrameView*);
+ bool ScrollWithMultiplier(const ScrollOffset&, Node*);
+#endif
+
EventHandlerRegistry& GetEventHandlerRegistry() const {
return *event_handler_registry_;
}
bool ScrollManager::LogicalScroll(mojom::blink::ScrollDirection direction,
ui::ScrollGranularity granularity,
Node* start_node,
- Node* mouse_press_node) {
+ Node* mouse_press_node,
+ float data) {
Node* node = start_node;
if (!node)
WrapWeakPersistent(scrollable_area)));
ScrollResult result = scrollable_area->UserScroll(
granularity,
- ToScrollDelta(physical_direction,
- ScrollableArea::DirectionBasedScrollDelta(granularity)),
+ ToScrollDelta(physical_direction, data),
std::move(callback));
if (result.DidScroll())
bool LogicalScroll(mojom::blink::ScrollDirection,
ui::ScrollGranularity,
Node* start_node,
- Node* mouse_press_node);
+ Node* mouse_press_node,
+ float data = 1.0);
// Performs a logical scroll that chains, crossing frames, starting from
// the given node or a reasonable default (focus/last clicked).
}
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void WidgetBase::DidEdgeScrollBy(const gfx::Point& offset, bool handled) {
+ widget_host_->DidEdgeScrollBy(offset, handled);
+}
+#endif
+
void WidgetBase::UpdateTooltipUnderCursor(const String& tooltip_text,
TextDirection dir) {
widget_host_->UpdateTooltipUnderCursor(
WidgetBaseClient* client() { return client_; }
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ void DidEdgeScrollBy(const gfx::Point& offset, bool handled);
+#endif
+
void UpdateTooltipUnderCursor(const String& tooltip_text, TextDirection dir);
// This function allows us to trigger a tooltip to show from a keypress. The
// tooltip will be positioned relative to the gfx::Rect. That rect corresponds
is_focused_node_editable_ = editable;
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void RWHVAuraCommonHelperEfl::DidEdgeScrollBy(const gfx::Point& offset,
+ bool handled) {
+ web_contents_->GetDelegate()->DidEdgeScrollBy(offset, handled);
+}
+#endif
+
void RWHVAuraCommonHelperEfl::OnGetMainFrameScrollbarVisible(
int callback_id, bool visible) {
web_contents_->GetDelegate()->OnGetMainFrameScrollbarVisible(callback_id,
#endif
bool is_content_editable);
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ void DidEdgeScrollBy(const gfx::Point& offset, bool handled) ;
+#endif
+
void OnGestureEvent(ui::GestureEvent* event);
void DidChangeInputType(bool is_password_field);
void BackgroundColorReceived(int callback_id, SkColor bg_color);
x_delta_(0.0),
y_delta_(0.0),
#if BUILDFLAG(IS_TIZEN_TV)
+ is_processing_edge_scroll_(false),
use_early_rwi_(false),
rwi_info_showed_(false),
#endif
network_context->SetAcceptLanguage(accept_languages);
}
+#if BUILDFLAG(IS_TIZEN_TV)
+bool EWebView::EdgeScrollBy(int delta_x, int delta_y) {
+ if ((delta_x == 0 && delta_y == 0) || is_processing_edge_scroll_)
+ return false;
+
+ RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
+ if (!render_view_host)
+ return false;
+
+ if (!rwhva())
+ return false;
+
+ gfx::Point offset = gfx::Point(delta_x, delta_y);
+ gfx::Point mouse_position;
+ GetMousePosition(mouse_position);
+ is_processing_edge_scroll_ = true;
+
+ static_cast<RenderViewHostImpl*>(render_view_host)
+ ->GetWidget()
+ ->GetAssociatedFrameWidget()
+ ->EdgeScrollBy(offset, mouse_position);
+ return true;
+}
+
+void EWebView::GetMousePosition(gfx::Point& mouse_position) {
+ int mouse_x, mouse_y;
+ evas_pointer_output_xy_get(GetEvas(), &mouse_x, &mouse_y);
+ Evas_Coord x, y, width, height;
+ evas_object_geometry_get(evas_object(), &x, &y, &width, &height);
+
+ if (mouse_y < y)
+ mouse_y = y + 1;
+ else if (mouse_y > y + height)
+ mouse_y = y + height - 1;
+ if (mouse_x < x)
+ mouse_x = x + 1;
+ else if (mouse_x > x + width)
+ mouse_x = x + width - 1;
+
+ mouse_x -= x;
+ mouse_y -= y;
+
+ mouse_x /=
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
+ mouse_y /=
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
+
+ mouse_position.set_x(mouse_x);
+ mouse_position.set_y(mouse_y);
+}
+
+void EWebView::InvokeEdgeScrollByCallback(const gfx::Point& offset,
+ bool handled) {
+ is_processing_edge_scroll_ = false;
+
+ if (offset.x() < 0)
+ SmartCallback<EWebViewCallbacks::EdgeScrollLeft>().call(&handled);
+ else if (offset.x() > 0)
+ SmartCallback<EWebViewCallbacks::EdgeScrollRight>().call(&handled);
+
+ if (offset.y() < 0)
+ SmartCallback<EWebViewCallbacks::EdgeScrollTop>().call(&handled);
+ else if (offset.y() > 0)
+ SmartCallback<EWebViewCallbacks::EdgeScrollBottom>().call(&handled);
+}
+#endif
+
void EWebView::HandleRendererProcessCrash() {
content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&EWebView::InvokeWebProcessCrashedCallback,
void ReplyBeforeUnloadConfirmPanel(Eina_Bool result);
void SyncAcceptLanguages(const std::string& accept_languages);
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ bool EdgeScrollBy(int delta_x, int delta_y);
+ void GetMousePosition(gfx::Point&);
+ void InvokeEdgeScrollByCallback(const gfx::Point&, bool);
+#endif
+
void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
const gfx::Vector2dF& latest_overscroll_delta);
bool is_initialized_;
#if BUILDFLAG(IS_TIZEN_TV)
+ bool is_processing_edge_scroll_;
bool use_early_rwi_;
bool rwi_info_showed_;
GURL rwi_gurl_;
EdgeTop,
EdgeBottom,
#if BUILDFLAG(IS_TIZEN_TV)
+ EdgeScrollBottom,
+ EdgeScrollLeft,
+ EdgeScrollRight,
+ EdgeScrollTop,
DeviceConnectionChanged,
PlaybackLoad,
PlaybackVideoReady,
DECLARE_EWK_VIEW_CALLBACK(EdgeBottom, "edge,bottom", void);
DECLARE_EWK_VIEW_CALLBACK(EdgeRight, "edge,right", void);
#if BUILDFLAG(IS_TIZEN_TV)
+DECLARE_EWK_VIEW_CALLBACK(EdgeScrollBottom, "edge,scroll,bottom", bool*);
+DECLARE_EWK_VIEW_CALLBACK(EdgeScrollLeft, "edge,scroll,left", bool*);
+DECLARE_EWK_VIEW_CALLBACK(EdgeScrollRight, "edge,scroll,right", bool*);
+DECLARE_EWK_VIEW_CALLBACK(EdgeScrollTop, "edge,scroll,top", bool*);
DECLARE_EWK_VIEW_CALLBACK(DeviceConnectionChanged,
"device,connection,changed",
int*);
Eina_Bool ewk_view_edge_scroll_by(Evas_Object *ewkView, int dx, int dy)
{
LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
+ LOG(INFO) << "view: " << ewkView << ", dx:" << dx << ", dy:" << dy;
+ return impl->EdgeScrollBy(dx, dy);
+#else
+ LOG_EWK_API_MOCKUP("edge_scroll_by feature is not enabled");
return EINA_FALSE;
+#endif
}
Eina_Bool ewk_view_set_support_video_hole(Evas_Object* ewkView,
bool visible) {
web_view_->InvokeMainFrameScrollbarVisibleCallback(callback_id, visible);
}
+
+#if BUILDFLAG(IS_TIZEN_TV)
+void WebContentsDelegateEfl::DidEdgeScrollBy(const gfx::Point& offset,
+ bool handled) {
+ if (web_view_)
+ web_view_->InvokeEdgeScrollByCallback(offset, handled);
+}
+#endif
} // namespace content
void DidChangeInputType(bool is_password_input) override;
void OnGetMainFrameScrollbarVisible(int callback_id, bool visible) override;
+
+#if BUILDFLAG(IS_TIZEN_TV)
+ //Browser edge scroll
+ void DidEdgeScrollBy(const gfx::Point& offset, bool handled) override;
+#endif
void RequestCertificateConfirm(
WebContents* web_contents,
int cert_error,
"utc_blink_ewk_view_custom_header_remove_func.cpp",
"utc_blink_ewk_view_did_change_theme_color_callback_set_func.cpp",
"utc_blink_ewk_view_draws_transparent_background_set_func.cpp",
+ "utc_blink_ewk_view_edge_scroll_by_func.cpp",
"utc_blink_ewk_view_encoding_custom_set_func.cpp",
"utc_blink_ewk_view_forward_func.cpp",
"utc_blink_ewk_view_forward_possible_func.cpp",
--- /dev/null
+// Copyright 2022 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "utc_blink_ewk_base.h"
+
+class utc_blink_ewk_view_edge_scroll_by : public utc_blink_ewk_base {
+ protected:
+ enum OrientaionType { Left, Right, Top, Bottom };
+
+ static void EdgeLeft(void* data, Evas_Object* o, void* data_finished) {
+ utc_message("[EdgeLeft] :: \n");
+ if (data) {
+ auto scroll = static_cast<utc_blink_ewk_view_edge_scroll_by*>(data);
+ if (scroll->orientation_ == Left)
+ scroll->EventLoopStop(Success);
+ }
+ }
+
+ static void EdgeRight(void* data, Evas_Object* o, void* data_finished) {
+ utc_message("[EdgeRight] :: \n");
+ if (data) {
+ auto scroll = static_cast<utc_blink_ewk_view_edge_scroll_by*>(data);
+ if (scroll->orientation_ == Right)
+ scroll->EventLoopStop(Success);
+ }
+ }
+
+ static void EdgeTop(void* data, Evas_Object* o, void* data_finished) {
+ utc_message("[EdgeTop] :: \n");
+ if (data) {
+ auto scroll = static_cast<utc_blink_ewk_view_edge_scroll_by*>(data);
+ if (scroll->orientation_ == Top)
+ scroll->EventLoopStop(Success);
+ }
+ }
+
+ static void EdgeBottom(void* data, Evas_Object* o, void* data_finished) {
+ utc_message("[EdgeBottom] :: \n");
+ if (data) {
+ auto scroll = static_cast<utc_blink_ewk_view_edge_scroll_by*>(data);
+ if (scroll->orientation_ == Bottom)
+ scroll->EventLoopStop(Success);
+ }
+ }
+
+ /* Startup function */
+ void PostSetUp() override {
+ evas_object_smart_callback_add(GetEwkWebView(), "edge,scroll,left",
+ EdgeLeft, this);
+ evas_object_smart_callback_add(GetEwkWebView(), "edge,scroll,right",
+ EdgeRight, this);
+ evas_object_smart_callback_add(GetEwkWebView(), "edge,scroll,top", EdgeTop,
+ this);
+ evas_object_smart_callback_add(GetEwkWebView(), "edge,scroll,bottom",
+ EdgeBottom, this);
+ }
+
+ /* Cleanup function */
+ void PreTearDown() override {
+ evas_object_smart_callback_del(GetEwkWebView(), "edge,scroll,left",
+ EdgeLeft);
+ evas_object_smart_callback_del(GetEwkWebView(), "edge,scroll,right",
+ EdgeRight);
+ evas_object_smart_callback_del(GetEwkWebView(), "edge,scroll,top", EdgeTop);
+ evas_object_smart_callback_del(GetEwkWebView(), "edge,scroll,bottom",
+ EdgeBottom);
+ }
+
+ protected:
+ OrientaionType orientation_;
+ static const char* const kResource;
+};
+
+const char* const utc_blink_ewk_view_edge_scroll_by::kResource =
+ "/ewk_view/index_big_red_square.html";
+
+/**
+ * @brief Positive test case of ewk_view_edge_scroll_by(),testing scroll left
+ */
+
+TEST_F(utc_blink_ewk_view_edge_scroll_by, POS_TEST_LEFT) {
+ ASSERT_TRUE(
+ ewk_view_url_set(GetEwkWebView(), GetResourceUrl(kResource).c_str()));
+
+ const int kDeltaX = -10;
+ const int kDeltaY = 0;
+ orientation_ = Left;
+
+ ASSERT_TRUE(ewk_view_edge_scroll_by(GetEwkWebView(), kDeltaX, kDeltaY));
+ ASSERT_EQ(Success, EventLoopStart());
+}
+
+/**
+ * @brief Positive test case of ewk_view_edge_scroll_by(),testing scroll right
+ */
+
+TEST_F(utc_blink_ewk_view_edge_scroll_by, POS_TEST_RIGHT) {
+ ASSERT_TRUE(
+ ewk_view_url_set(GetEwkWebView(), GetResourceUrl(kResource).c_str()));
+
+ const int kDeltaX = 10;
+ const int kDeltaY = 0;
+ orientation_ = Right;
+
+ ASSERT_TRUE(ewk_view_edge_scroll_by(GetEwkWebView(), kDeltaX, kDeltaY));
+ ASSERT_EQ(Success, EventLoopStart());
+}
+
+/**
+ * @brief Positive test case of ewk_view_edge_scroll_by(),testing scroll top
+ */
+
+TEST_F(utc_blink_ewk_view_edge_scroll_by, POS_TEST_TOP) {
+ ASSERT_TRUE(
+ ewk_view_url_set(GetEwkWebView(), GetResourceUrl(kResource).c_str()));
+
+ const int kDeltaX = 0;
+ const int kDeltaY = -10;
+ orientation_ = Top;
+
+ ASSERT_TRUE(ewk_view_edge_scroll_by(GetEwkWebView(), kDeltaX, kDeltaY));
+ ASSERT_EQ(Success, EventLoopStart());
+}
+
+/**
+ * @brief Positive test case of ewk_view_edge_scroll_by(),testing scroll bottom
+ */
+
+TEST_F(utc_blink_ewk_view_edge_scroll_by, POS_TEST_BOTTOM) {
+ ASSERT_TRUE(
+ ewk_view_url_set(GetEwkWebView(), GetResourceUrl(kResource).c_str()));
+
+ const int kDeltaX = 0;
+ const int kDeltaY = 10;
+ orientation_ = Bottom;
+
+ ASSERT_TRUE(ewk_view_edge_scroll_by(GetEwkWebView(), kDeltaX, kDeltaY));
+ ASSERT_EQ(Success, EventLoopStart());
+}
+
+/**
+ * @brief Negative test case of ewk_view_edge_scroll_by(), testing for null
+ */
+TEST_F(utc_blink_ewk_view_edge_scroll_by, NEG_TEST) {
+ EXPECT_EQ(EINA_FALSE, ewk_view_edge_scroll_by(NULL, 1916, 1993));
+}