[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_cb_icon_received.cpp
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.
4
5 #include "utc_blink_ewk_base.h"
6
7 class utc_blink_cb_icon_received : public utc_blink_ewk_base
8 {
9 protected:
10  void PostSetUp() override {
11    evas_object_smart_callback_add(GetEwkWebView(), "icon,received",
12                                   cb_icon_received, this);
13   }
14
15   void PreTearDown() override {
16     evas_object_smart_callback_del(GetEwkWebView(), "icon,received", cb_icon_received);
17   }
18
19   static void cb_icon_received(void *data, Evas_Object *, void *)
20   {
21     ASSERT_TRUE(data != NULL);
22     utc_blink_cb_icon_received *owner = static_cast<utc_blink_cb_icon_received *>(data);
23     owner->EventLoopStop(Success);
24   }
25 };
26
27 TEST_F(utc_blink_cb_icon_received, PAGE_WITH_FAVICON)
28 {
29   ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), GetResourceUrl("common/favicon.html").c_str()));
30   ASSERT_EQ(Success, EventLoopStart());
31 }
32
33 TEST_F(utc_blink_cb_icon_received, PAGE_WITHOUT_FAVICON)
34 {
35   ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), GetResourceUrl("common/sample.html").c_str()));
36   ASSERT_EQ(Failure, EventLoopStart(5));
37 }