[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_notification_id_get_func.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 /* Define those macros _before_ you include the utc_blink_ewk.h header file. */
6
7 #include "utc_blink_ewk_notification_test_base.h"
8
9 class utc_blink_ewk_notification_id_get : public utc_blink_ewk_notification_test_base {
10  protected:
11   utc_blink_ewk_notification_id_get()
12     : notification_id(0)
13   {}
14
15   void NotificationShow(Ewk_Notification* notification) override
16   {
17     //call ewk_notification API
18     notification_id = ewk_notification_id_get(notification);
19     EventLoopStop(Success);
20   }
21
22  protected:
23   uint64_t notification_id;
24 };
25
26 /**
27 * @brief Positive test case for ewk_notification_id_get(). Text returned by
28 * api is compared against expected text and result is set in notificationShow()
29 */
30 TEST_F(utc_blink_ewk_notification_id_get, POS_TEST)
31 {
32   ASSERT_TRUE(ewk_view_url_set(GetEwkWebView(), notification_sample_1.c_str()));
33   ASSERT_EQ(Success, EventLoopStart());
34   ASSERT_TRUE(notification_id);
35 }
36
37 /**
38 * @brief Checking whether function works properly in case of nullptr.
39 */
40 TEST_F(utc_blink_ewk_notification_id_get, NEG_TEST)
41 {
42   ASSERT_EQ(0, ewk_notification_id_get(nullptr));
43 }