1 // Copyright 2014 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "utc_blink_ewk_base.h"
7 class utc_blink_ewk_view_screenshot_contents_get : public utc_blink_ewk_base
10 /* Callback for load finished */
11 void LoadFinished(Evas_Object* webview) override { EventLoopStop(Success); }
14 static const char*const url;
18 * @brief Checking whether the evas image object of the specified viewArea of page is returned.
21 TEST_F(utc_blink_ewk_view_screenshot_contents_get, POS_TEST)
23 char htmlBuffer[] = "<html>"
29 bool result = ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL);
34 if (Success!=EventLoopStart())
37 Eina_Rectangle snapshot_rect;
38 snapshot_rect.x = snapshot_rect.y = 0;
39 evas_object_geometry_get(GetEwkWebView(), NULL, NULL, &snapshot_rect.w, &snapshot_rect.h);
41 Evas_Object *webview = ewk_view_screenshot_contents_get(GetEwkWebView(), snapshot_rect, 1.0f, evas_object_evas_get(GetEwkWebView()));
46 utc_check_eq(result, EINA_TRUE);
50 * @brief Checking whether function works properly in case that webview and canvas object are NULL.
52 TEST_F(utc_blink_ewk_view_screenshot_contents_get, NEG_TEST)
54 Eina_Rectangle snapshot_rect;
55 snapshot_rect.x = snapshot_rect.y = 0;
56 evas_object_geometry_get(GetEwkWebView(), NULL, NULL, &snapshot_rect.w, &snapshot_rect.h);
58 utc_check_eq(NULL, ewk_view_screenshot_contents_get(NULL, snapshot_rect, 1.0f, NULL));