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_resume : public utc_blink_ewk_base
17 utc_blink_ewk_view_resume()
18 : phase(PageLoadStart)
22 /* Callback for quitting main loop */
23 void LoadProgress(Evas_Object* webview, double pr)
25 // Page started to load, after that we want to suspend right after
26 if (phase == PageLoadStart) {
27 phase = PageSuspended;
28 EventLoopStop(Success);
34 if (phase == PageSuspended) {
36 EventLoopStop(Success);
43 void LoadFinished(Evas_Object* webview)
45 if (phase == PageResumed) {
46 EventLoopStop(Success);
48 EventLoopStop(Failure);
57 * @brief Positive test case of ewk_view_resume()
59 TEST_F(utc_blink_ewk_view_resume, POS_TEST)
61 if (!ewk_view_url_set(GetEwkWebView(), "http://www.google.pl"))
64 if (Success != EventLoopStart())
67 utc_message("Suspend");
68 ewk_view_suspend(GetEwkWebView());
70 if (Success != EventLoopStart(5.0)) // Wait few seconds to see if it realy was suspended
73 utc_message("Resume");
74 ewk_view_resume(GetEwkWebView());
76 if (Success != EventLoopStart())
79 evas_object_show(GetEwkWebView());
80 evas_object_show(GetEwkWindow());
84 * @brief Negative test case of ewk_view_resume()
86 TEST_F(utc_blink_ewk_view_resume, NEG_TEST)
88 // This test is pointless. ewk_view_resume has no return value so we have nothing to test here.
89 ewk_view_resume(NULL);
90 evas_object_show(GetEwkWebView());
91 evas_object_show(GetEwkWindow());