- a/Source/WebKit/ChangeLog +10 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2012-06-27  Sheriff Bot  <webkit.review.bot@gmail.com>
2
3
        Unreviewed, rolling out r121398.
4
        http://trac.webkit.org/changeset/121398
5
        https://bugs.webkit.org/show_bug.cgi?id=90136
6
7
        broke efl build (Requested by ryuan on #webkit).
8
9
        * PlatformEfl.cmake:
10
1
2012-06-27  Krzysztof Czech  <k.czech@samsung.com>
11
2012-06-27  Krzysztof Czech  <k.czech@samsung.com>
2
12
3
        [EFL] Add support for Unit Tests, based on the gtest library.
13
        [EFL] Add support for Unit Tests, based on the gtest library.
- a/Source/WebKit/efl/ChangeLog +17 lines
Lines 1-3 a/Source/WebKit/efl/ChangeLog_sec1
1
2012-06-27  Sheriff Bot  <webkit.review.bot@gmail.com>
2
3
        Unreviewed, rolling out r121398.
4
        http://trac.webkit.org/changeset/121398
5
        https://bugs.webkit.org/show_bug.cgi?id=90136
6
7
        broke efl build (Requested by ryuan on #webkit).
8
9
        * tests/UnitTestUtils/EWKTestBase.cpp: Removed.
10
        * tests/UnitTestUtils/EWKTestBase.h: Removed.
11
        * tests/UnitTestUtils/EWKTestConfig.h: Removed.
12
        * tests/UnitTestUtils/EWKTestView.cpp: Removed.
13
        * tests/UnitTestUtils/EWKTestView.h: Removed.
14
        * tests/resources/default_test_page.html: Removed.
15
        * tests/test_ewk_view.cpp: Removed.
16
        * tests/test_runner.cpp: Removed.
17
1
2012-06-27  Krzysztof Czech  <k.czech@samsung.com>
18
2012-06-27  Krzysztof Czech  <k.czech@samsung.com>
2
19
3
        [EFL] Implementation of testing framework and unit tests for WebKit-EFL port.
20
        [EFL] Implementation of testing framework and unit tests for WebKit-EFL port.
- a/Source/WebKit/PlatformEfl.cmake -80 lines
Lines 293-375 INSTALL(FILES ${EWebKit_HEADERS} a/Source/WebKit/PlatformEfl.cmake_sec1
293
293
294
INSTALL(FILES ${WebKit_THEME}
294
INSTALL(FILES ${WebKit_THEME}
295
        DESTINATION ${DATA_INSTALL_DIR}/themes)
295
        DESTINATION ${DATA_INSTALL_DIR}/themes)
296
297
INCLUDE_DIRECTORIES(${THIRDPARTY_DIR}/gtest
298
                    ${THIRDPARTY_DIR}/gtest/include
299
)
300
301
SET(GTEST_SOURCES "${THIRDPARTY_DIR}/gtest/src")
302
303
ADD_LIBRARY(gtest
304
    ${GTEST_SOURCES}/gtest.cc
305
    ${GTEST_SOURCES}/gtest-death-test.cc
306
    ${GTEST_SOURCES}/gtest_main.cc
307
    ${GTEST_SOURCES}/gtest-filepath.cc
308
    ${GTEST_SOURCES}/gtest-port.cc
309
    ${GTEST_SOURCES}/gtest-test-part.cc
310
    ${GTEST_SOURCES}/gtest-typed-test.cc
311
)
312
313
SET(EWKUnitTests_LIBRARIES
314
    ${JavaScriptCore_LIBRARY_NAME}
315
    ${WebCore_LIBRARY_NAME}
316
    ${WebKit_LIBRARY_NAME}
317
    ${ECORE_LIBRARIES}
318
    ${ECORE_EVAS_LIBRARIES}
319
    ${EVAS_LIBRARIES}
320
    ${EDJE_LIBRARIES}
321
)
322
323
SET(EWKUnitTests_INCLUDE_DIRECTORIES
324
    "${CMAKE_SOURCE_DIR}/Source"
325
    "${WEBKIT_DIR}/efl/ewk"
326
    "${WEBKIT_DIR}/efl/tests/src/UnitTestUtils"
327
    "${JAVASCRIPTCORE_DIR}"
328
    "${WTF_DIR}"
329
    "${WTF_DIR}/wtf"
330
    ${ECORE_INCLUDE_DIRS}
331
    ${ECORE_EVAS_INCLUDE_DIRS}
332
    ${EVAS_INCLUDE_DIRS}
333
    ${EDJE_INCLUDE_DIRS}
334
)
335
336
SET(EWKUnitTests_LINK_FLAGS
337
    ${ECORE_LDFLAGS}
338
    ${ECORE_EVAS_LDFLAGS}
339
    ${EVAS_LDFLAGS}
340
    ${EDJE_LDFLAGS}
341
)
342
343
IF (ENABLE_GLIB_SUPPORT)
344
    LIST(APPEND EWKUnitTests_INCLUDE_DIRECTORIES "${WTF_DIR}/wtf/gobject")
345
346
    LIST(APPEND EWKUnitTests_LIBRARIES
347
        ${Gdk_LIBRARIES}
348
        ${Glib_LIBRARIES}
349
        ${Gthread_LIBRARIES}
350
    )
351
ENDIF ()
352
353
SET(DEFAULT_TEST_PAGE_DIR ${CMAKE_SOURCE_DIR}/Source/WebKit/efl/tests/resources)
354
355
ADD_DEFINITIONS(-DDEFAULT_TEST_PAGE_DIR=\"${DEFAULT_TEST_PAGE_DIR}\")
356
ADD_DEFINITIONS(-DDEFAULT_THEME_PATH=\"${THEME_BINARY_DIR}\")
357
358
ADD_LIBRARY(ewkTestUtils
359
    ${WEBKIT_DIR}/efl/tests/UnitTestUtils/EWKTestBase.cpp
360
    ${WEBKIT_DIR}/efl/tests/UnitTestUtils/EWKTestView.cpp
361
)
362
363
SET(WEBKIT_EFL_TEST_DIR "${WEBKIT_DIR}/efl/tests/")
364
365
SET(EWKUnitTests_BINARIES
366
    test_ewk_view
367
)
368
369
FOREACH(testName ${EWKUnitTests_BINARIES})
370
    ADD_EXECUTABLE(bin/${testName} ${WEBKIT_EFL_TEST_DIR}/${testName}.cpp ${WEBKIT_EFL_TEST_DIR}/test_runner.cpp)
371
    TARGET_LINK_LIBRARIES(bin/${testName} ${EWKUnitTests_LIBRARIES} ewkTestUtils gtest pthread)
372
    ADD_TARGET_PROPERTIES(bin/${testName} LINK_FLAGS "${EWKUnitTests_LINK_FLAGS}")
373
    SET_TARGET_PROPERTIES(bin/${testName} PROPERTIES FOLDER "WebKit")
374
    SET_TARGET_PROPERTIES(bin/${testName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
375
ENDFOREACH()
- a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.cpp -109 lines
Lines 1-109 a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.cpp_sec1
1
/*
2
    Copyright (C) 2012 Samsung Electronics
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Lesser General Public
6
    License as published by the Free Software Foundation; either
7
    version 2.1 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
    Lesser General Public License for more details.
13
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this library; if not, write to the Free Software Foundation,
16
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#include "config.h"
20
#include "EWKTestBase.h"
21
22
#include "EWKTestConfig.h"
23
#include "EWKTestView.h"
24
#include <EWebKit.h>
25
26
#include <Ecore.h>
27
#include <Edje.h>
28
29
int EWKUnitTests::EWKTestBase::useX11Window;
30
31
namespace EWKUnitTests {
32
33
bool EWKTestBase::init()
34
{
35
    if (!ecore_evas_init())
36
        return false;
37
38
    if (!edje_init()) {
39
        ecore_evas_shutdown();
40
        return false;
41
    }
42
43
    int ret = ewk_init();
44
    const char* proxyUri = getenv("http_proxy");
45
46
    if (ret && proxyUri)
47
        ewk_network_proxy_uri_set(proxyUri);
48
49
    return ret;
50
}
51
52
void EWKTestBase::shutdown()
53
{
54
    ecore_evas_shutdown();
55
    edje_shutdown();
56
    ewk_shutdown();
57
}
58
59
void EWKTestBase::shutdownAll()
60
{
61
    int count = 0;
62
63
    while ((count = ecore_evas_shutdown()) > 0) { }
64
    while ((count = edje_shutdown()) > 0) { }
65
    while ((count = ewk_shutdown()) > 0) { }
66
}
67
68
void EWKTestBase::startTest()
69
{
70
    ecore_main_loop_begin();
71
}
72
73
void EWKTestBase::endTest()
74
{
75
    ecore_main_loop_quit();
76
}
77
78
bool EWKTestBase::createTest(const char* url, void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data)
79
{
80
    EFL_INIT_RET();
81
82
    EWKTestEcoreEvas evas(useX11Window);
83
    if (!evas.evas())
84
        return false;
85
    evas.show();
86
87
    EWKTestView view(evas.evas(), url);
88
    if (!view.init())
89
        return false;
90
91
    view.bindEvents(event_callback, event_name, event_data);
92
    view.show();
93
94
    START_TEST();
95
96
    return true;
97
}
98
99
bool EWKTestBase::runTest(void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data)
100
{
101
    return createTest(Config::defaultTestPage, event_callback, event_name, event_data);
102
}
103
104
bool EWKTestBase::runTest(const char* url, void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data)
105
{
106
    return createTest(url, event_callback, event_name, event_data);
107
}
108
109
}
- a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h -70 lines
Lines 1-70 a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h_sec1
1
/*
2
    Copyright (C) 2012 Samsung Electronics
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Lesser General Public
6
    License as published by the Free Software Foundation; either
7
    version 2.1 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
    Lesser General Public License for more details.
13
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this library; if not, write to the Free Software Foundation,
16
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#ifndef EWKTestBase_h
20
#define EWKTestBase_h
21
22
#include <Evas.h>
23
#include <gtest/gtest.h>
24
25
#define RUN_TEST(args...)   \
26
    do {    \
27
        ASSERT_EQ(true, EWKTestBase::runTest(args));    \
28
    } while (0)
29
30
#define START_TEST()    \
31
    do {    \
32
        EWKTestBase::startTest();   \
33
    } while (0)
34
35
#define END_TEST()    \
36
    do {    \
37
        EWKTestBase::endTest(); \
38
    } while (0)
39
40
#define EFL_INIT_RET()  \
41
    do {    \
42
        if (!EWKTestBase::init())   \
43
            return false;    \
44
    } while (0)
45
46
#define EFL_INIT()  \
47
    do {    \
48
        EWKTestBase::init();    \
49
    } while (0)
50
51
namespace EWKUnitTests {
52
53
class EWKTestBase {
54
    static bool createTest(const char* url, void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data);
55
public:
56
    static bool init();
57
    static void shutdown();
58
    static void shutdownAll();
59
    static void startTest();
60
    static void endTest();
61
62
    static bool runTest(const char* url, void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data);
63
    static bool runTest(void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data);
64
65
    static int useX11Window;
66
};
67
68
}
69
70
#endif
- a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestConfig.h -31 lines
Lines 1-31 a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestConfig.h_sec1
1
/*
2
    Copyright (C) 2012 Samsung Electronics
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Lesser General Public
6
    License as published by the Free Software Foundation; either
7
    version 2.1 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
    Lesser General Public License for more details.
13
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this library; if not, write to the Free Software Foundation,
16
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#ifndef EWKTestConfig_h
20
#define EWKTestConfig_h
21
22
namespace EWKUnitTests {
23
namespace Config {
24
static const int defaultViewWidth = 600;
25
static const int defaultViewHeight = 800;
26
static const char* const defaultThemePath = DEFAULT_THEME_PATH"/default.edj";
27
static const char* const defaultTestPage = "file://"DEFAULT_TEST_PAGE_DIR"/default_test_page.html";
28
}
29
}
30
31
#endif
- a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestView.cpp -148 lines
Lines 1-148 a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestView.cpp_sec1
1
/*
2
    Copyright (C) 2012 Samsung Electronics
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Lesser General Public
6
    License as published by the Free Software Foundation; either
7
    version 2.1 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
    Lesser General Public License for more details.
13
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this library; if not, write to the Free Software Foundation,
16
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#include "config.h"
20
#include "EWKTestView.h"
21
22
#include "EWKTestConfig.h"
23
#include <EWebKit.h>
24
25
#include <wtf/PassOwnPtr.h>
26
27
namespace EWKUnitTests {
28
29
EWKTestEcoreEvas::EWKTestEcoreEvas(int useX11Window)
30
{
31
    if (useX11Window)
32
        m_ecoreEvas = adoptPtr(ecore_evas_new(0, 0, 0, Config::defaultViewWidth, Config::defaultViewHeight, 0));
33
    else
34
        m_ecoreEvas = adoptPtr(ecore_evas_buffer_new(Config::defaultViewWidth, Config::defaultViewHeight));
35
}
36
37
EWKTestEcoreEvas::EWKTestEcoreEvas(const char* engine_name, int viewport_x, int viewport_y, int viewport_w, int viewport_h, const char* extra_options, int useX11Window)
38
{
39
    if (useX11Window)
40
        m_ecoreEvas = adoptPtr(ecore_evas_new(engine_name, viewport_x, viewport_y, viewport_w, viewport_h, extra_options));
41
    else
42
        m_ecoreEvas = adoptPtr(ecore_evas_buffer_new(viewport_x, viewport_y));
43
}
44
45
Evas* EWKTestEcoreEvas::evas()
46
{
47
    if (m_ecoreEvas.get())
48
        return ecore_evas_get(m_ecoreEvas.get());
49
    return 0;
50
}
51
52
void EWKTestEcoreEvas::show()
53
{
54
    if (m_ecoreEvas.get())
55
        ecore_evas_show(m_ecoreEvas.get());
56
}
57
58
EWKTestView::EWKTestView(Evas* evas)
59
    : m_evas(evas)
60
    , m_url(Config::defaultTestPage)
61
    , m_defaultViewType(TiledView)
62
    , m_width(Config::defaultViewWidth)
63
    , m_height(Config::defaultViewHeight)
64
{
65
}
66
67
EWKTestView::EWKTestView(Evas* evas, const char* url)
68
    : m_evas(evas)
69
    , m_url(url)
70
    , m_defaultViewType(TiledView)
71
    , m_width(Config::defaultViewWidth)
72
    , m_height(Config::defaultViewHeight)
73
{
74
}
75
76
EWKTestView::EWKTestView(Evas* evas, EwkViewType type, const char* url)
77
    : m_evas(evas)
78
    , m_url(url)
79
    , m_defaultViewType(type)
80
    , m_width(Config::defaultViewWidth)
81
    , m_height(Config::defaultViewHeight)
82
{
83
}
84
85
EWKTestView::EWKTestView(Evas* evas, EwkViewType type, const char* url, int width, int height)
86
    : m_evas(evas)
87
    , m_url(url)
88
    , m_defaultViewType(type)
89
    , m_width(width)
90
    , m_height(height)
91
{
92
}
93
94
bool EWKTestView::init()
95
{
96
    if (!m_evas || m_url.empty())
97
        return false;
98
99
    switch (m_defaultViewType) {
100
    case SingleView:
101
        m_webView = adoptPtr(ewk_view_single_add(m_evas));
102
        break;
103
104
    case TiledView:
105
        m_webView = adoptPtr(ewk_view_tiled_add(m_evas));
106
        break;
107
    }
108
109
    if (!m_webView.get())
110
        return false;
111
112
    ewk_view_theme_set(m_webView.get(), Config::defaultThemePath);
113
    ewk_view_uri_set(m_webView.get(), m_url.c_str());
114
}
115
116
void EWKTestView::show()
117
{
118
    if (!m_webView.get())
119
        return;
120
    evas_object_resize(m_webView.get(), m_width, m_height);
121
    evas_object_show(m_webView.get());
122
    evas_object_focus_set(m_webView.get(), EINA_TRUE);
123
}
124
125
Evas_Object* EWKTestView::mainFrame()
126
{
127
    if (m_webView.get())
128
        return ewk_view_frame_main_get(m_webView.get());
129
    return 0;
130
}
131
132
Evas* EWKTestView::evas()
133
{
134
    if (m_webView.get())
135
        return evas_object_evas_get(m_webView.get());
136
    return 0;
137
}
138
139
void EWKTestView::bindEvents(void (*callback)(void*, Evas_Object*, void*), const char* eventName, void* ptr)
140
{
141
    if (!m_webView.get())
142
        return;
143
144
    evas_object_smart_callback_del(m_webView.get(), eventName, callback);
145
    evas_object_smart_callback_add(m_webView.get(), eventName, callback, ptr);
146
}
147
148
}
- a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestView.h -75 lines
Lines 1-75 a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestView.h_sec1
1
/*
2
    Copyright (C) 2012 Samsung Electronics
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Lesser General Public
6
    License as published by the Free Software Foundation; either
7
    version 2.1 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
    Lesser General Public License for more details.
13
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this library; if not, write to the Free Software Foundation,
16
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#ifndef EWKTestView_h
20
#define EWKTestView_h
21
22
#include <Ecore_Evas.h>
23
#include <Evas.h>
24
#include <string>
25
#include <wtf/OwnPtr.h>
26
27
namespace EWKUnitTests {
28
29
class EWKTestEcoreEvas {
30
public:
31
    EWKTestEcoreEvas(int useX11Window);
32
    EWKTestEcoreEvas(const char* engine_name, int viewport_x, int viewport_y, int viewport_w, int viewport_h, const char* extra_options, int useX11Window);
33
34
    Evas* evas();
35
    void show();
36
37
private:
38
    OwnPtr<Ecore_Evas> m_ecoreEvas;
39
};
40
41
class EWKTestView {
42
public:
43
    enum EwkViewType {
44
        SingleView = 0,
45
        TiledView,
46
    };
47
48
    explicit EWKTestView(Evas*);
49
    EWKTestView(Evas*, const char* url);
50
    EWKTestView(Evas*, EwkViewType, const char* url);
51
    EWKTestView(Evas*, EwkViewType, const char* url, int width, int height);
52
53
    Evas_Object* webView() { return m_webView.get(); }
54
    Evas_Object* mainFrame();
55
    Evas* evas();
56
    void show();
57
58
    bool init();
59
    void bindEvents(void (*callback)(void*, Evas_Object*, void*), const char* eventName, void* ptr);
60
61
private:
62
    EWKTestView(const EWKTestView&);
63
    EWKTestView operator=(const EWKTestView&);
64
65
    Evas* m_evas;
66
    OwnPtr<Evas_Object> m_webView;
67
68
    int m_width, m_height;
69
    EwkViewType m_defaultViewType;
70
    std::string m_url;
71
};
72
73
}
74
75
#endif
- a/Source/WebKit/efl/tests/resources/default_test_page.html -6 lines
Lines 1-6 a/Source/WebKit/efl/tests/resources/default_test_page.html_sec1
1
<HTML>
2
<BODY>
3
<H2 align="center">EFL Unit Tests</H2>
4
<H2 align="center">Default Testing Web Page</H2>
5
</BODY>
6
</HTML>
- a/Source/WebKit/efl/tests/test_ewk_view.cpp -54 lines
Lines 1-54 a/Source/WebKit/efl/tests/test_ewk_view.cpp_sec1
1
/*
2
    Copyright (C) 2012 Samsung Electronics
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Lesser General Public
6
    License as published by the Free Software Foundation; either
7
    version 2.1 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
    Lesser General Public License for more details.
13
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this library; if not, write to the Free Software Foundation,
16
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#include "config.h"
20
21
#include "UnitTestUtils/EWKTestBase.h"
22
#include <EWebKit.h>
23
#include <gtest/gtest.h>
24
25
using namespace EWKUnitTests;
26
27
/**
28
* @brief Checking whether function properly returns correct value.
29
*/
30
void ewkViewEditableGetCb(void* eventInfo, Evas_Object* o, void* data)
31
{
32
    ewk_view_editable_set(o, EINA_FALSE);
33
    EXPECT_EQ(EINA_FALSE, ewk_view_editable_get(o));
34
    END_TEST();
35
}
36
37
TEST(test_ewk_view, ewk_view_editable_get)
38
{
39
    RUN_TEST(ewkViewEditableGetCb, "load,finished", 0);
40
}
41
42
/**
43
* @brief Checking whether function returns correct uri string.
44
*/
45
void ewkViewUriGetCb(void* eventInfo, Evas_Object* o, void* data)
46
{
47
    EXPECT_STREQ("http://www.webkit.org/", ewk_view_uri_get(o));
48
    END_TEST();
49
}
50
51
TEST(test_ewk_view, ewk_view_uri_get)
52
{
53
    RUN_TEST("http://www.webkit.org", ewkViewUriGetCb, "load,finished", 0);
54
}
- a/Source/WebKit/efl/tests/test_runner.cpp -40 lines
Lines 1-40 a/Source/WebKit/efl/tests/test_runner.cpp_sec1
1
/*
2
    Copyright (C) 2012 Samsung Electronics
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Lesser General Public
6
    License as published by the Free Software Foundation; either
7
    version 2.1 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
    Lesser General Public License for more details.
13
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this library; if not, write to the Free Software Foundation,
16
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#include "UnitTestUtils/EWKTestBase.h"
20
#include <getopt.h>
21
#include <gtest/gtest.h>
22
23
static void parseCustomArguments(int argc, char** argv)
24
{
25
    static const option options[] = {
26
        {"useX11Window", no_argument, &EWKUnitTests::EWKTestBase::useX11Window, true},
27
        {0, 0, 0, 0}
28
    };
29
30
    int option;
31
    while ((option = getopt_long(argc, argv, "", options, 0)) != -1) { }
32
}
33
34
int main(int argc, char** argv)
35
{
36
    atexit(EWKUnitTests::EWKTestBase::shutdownAll);
37
    parseCustomArguments(argc, argv);
38
    ::testing::InitGoogleTest(&argc, argv);
39
    return RUN_ALL_TESTS();
40
}

Return to Bug 90136