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_inspector_server_stop : public utc_blink_ewk_base
10 void LoadFinished(Evas_Object* webview) override { EventLoopStop(Success); }
13 /* @brief Try stop inspector with NULL as context */
14 TEST_F(utc_blink_ewk_context_inspector_server_stop, NullArg)
16 ASSERT_NE(EINA_TRUE, ewk_context_inspector_server_stop(NULL));
19 /* @brief Try stop inspector without start */
20 TEST_F(utc_blink_ewk_context_inspector_server_stop, WithOutStart)
22 ASSERT_NE(EINA_TRUE, ewk_context_inspector_server_stop(ewk_context_default_get()));
25 /* @brief Try start inspector after stop */
26 TEST_F(utc_blink_ewk_context_inspector_server_stop, StartStop)
28 ASSERT_EQ(11111, ewk_context_inspector_server_start(ewk_context_default_get(), 11111));
31 ASSERT_EQ(EINA_TRUE, ewk_context_inspector_server_stop(ewk_context_default_get()));
34 ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), "http://localhost:11111"));
35 EXPECT_NE(Success, EventLoopStart());
37 ASSERT_EQ(11111, ewk_context_inspector_server_start(ewk_context_default_get(), 11111));
40 ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), "http://localhost:11111"));
41 EXPECT_EQ(Success, EventLoopStart());
43 // must stop inspector because default context will be shared between tests
44 ASSERT_EQ(EINA_TRUE, ewk_context_inspector_server_stop(ewk_context_default_get()));