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_context_web_storage_origins_get: public utc_blink_ewk_base
10 utc_blink_ewk_context_web_storage_origins_get()
15 void LoadFinished(Evas_Object*) override { EventLoopStop(Success); }
17 void PostSetUp() override {
18 ctx = ewk_view_context_get(GetEwkWebView());
22 static void origins_get_cb(Eina_List* origins, void* user_data)
24 // We don't need origins here
26 ewk_context_origins_free(origins);
29 ASSERT_TRUE(user_data);
31 utc_blink_ewk_context_web_storage_origins_get* owner = static_cast<utc_blink_ewk_context_web_storage_origins_get*>(user_data);
32 owner->EventLoopStop(Success);
37 static const char* const web_storage_sample_url;
40 const char* const utc_blink_ewk_context_web_storage_origins_get::web_storage_sample_url = "http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_webstorage_local";
42 TEST_F(utc_blink_ewk_context_web_storage_origins_get, callback)
44 ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), web_storage_sample_url));
45 ASSERT_EQ(Success, EventLoopStart());
46 ASSERT_EQ(EINA_TRUE, ewk_context_web_storage_origins_get(ctx, origins_get_cb, this));
47 ASSERT_EQ(Success, EventLoopStart());
50 TEST_F(utc_blink_ewk_context_web_storage_origins_get, invalid_args)
52 ASSERT_EQ(EINA_FALSE, ewk_context_web_storage_origins_get(NULL, NULL, NULL));
53 ASSERT_EQ(EINA_FALSE, ewk_context_web_storage_origins_get(ctx, NULL, NULL));
54 ASSERT_EQ(EINA_FALSE, ewk_context_web_storage_origins_get(NULL, origins_get_cb, NULL));