Exemplo n.º 1
0
WebViewTest::WebViewTest()
    : m_webView(WEBKIT_WEB_VIEW(g_object_ref_sink(webkit_web_view_new())))
    , m_mainLoop(g_main_loop_new(0, TRUE))
    , m_parentWindow(0)
    , m_javascriptResult(0)
{
    assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
}
 BackForwardListTest()
     : m_list(webkit_web_view_get_back_forward_list(m_webView))
     , m_changedFlags(0)
     , m_hasChanged(false)
     , m_expectedRemovedItems(0)
 {
     g_signal_connect(m_list, "changed", G_CALLBACK(backForwardListChanged), this);
     assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_list));
 }
Exemplo n.º 3
0
WebViewTest::WebViewTest(WebKitUserContentManager* userContentManager)
    : m_webView(WEBKIT_WEB_VIEW(g_object_ref_sink(g_object_new(WEBKIT_TYPE_WEB_VIEW, "web-context", m_webContext.get(), "user-content-manager", userContentManager, nullptr))))
    , m_mainLoop(g_main_loop_new(nullptr, TRUE))
    , m_parentWindow(nullptr)
    , m_javascriptResult(nullptr)
    , m_resourceDataSize(0)
    , m_surface(nullptr)
    , m_expectedWebProcessCrash(false)
{
    assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
    g_signal_connect(m_webView, "web-process-crashed", G_CALLBACK(WebViewTest::webProcessCrashed), this);
}
Exemplo n.º 4
0
 InspectorTest()
     : WebViewTest()
     , m_inspector(webkit_web_view_get_inspector(m_webView))
 {
     webkit_settings_set_enable_developer_extras(webkit_web_view_get_settings(m_webView), TRUE);
     assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_inspector));
     g_signal_connect(m_inspector, "open-window", G_CALLBACK(openWindowCallback), this);
     g_signal_connect(m_inspector, "bring-to-front", G_CALLBACK(bringToFrontCallback), this);
     g_signal_connect(m_inspector, "closed", G_CALLBACK(closedCallback), this);
     g_signal_connect(m_inspector, "attach", G_CALLBACK(attachCallback), this);
     g_signal_connect(m_inspector, "detach", G_CALLBACK(detachCallback), this);
 }
Exemplo n.º 5
0
    bool loadFailedWithTLSErrors(const char* failingURI, GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors) override
    {
        LoadTrackingTest::loadFailedWithTLSErrors(failingURI, certificate, tlsErrors);

        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(certificate));
        m_certificate = certificate;
        m_tlsErrors = tlsErrors;
        if (m_failingURI)
            soup_uri_free(m_failingURI);
        m_failingURI = soup_uri_new(failingURI);
        return true;
    }
Exemplo n.º 6
0
    GList* checkCurrentItemIsStockActionAndGetNext(GList* items, WebKitContextMenuAction stockAction, unsigned state)
    {
        g_assert(items);
        g_assert(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data));

        WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(items->data);
        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(item));

        GtkAction* action = webkit_context_menu_item_get_action(item);
        g_assert(GTK_IS_ACTION(action));

        g_assert_cmpint(webkit_context_menu_item_get_stock_action(item), ==, stockAction);

        checkActionState(action, state);

        return g_list_next(items);
    }
Exemplo n.º 7
0
    GList* checkCurrentItemIsSubMenuAndGetNext(GList* items, const char* label, unsigned state, GList** subMenuIter)
    {
        g_assert(items);
        g_assert(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data));

        WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(items->data);
        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(item));

        GtkAction* action = webkit_context_menu_item_get_action(item);
        g_assert(GTK_IS_ACTION(action));

        g_assert_cmpstr(gtk_action_get_label(action), ==, label);
        checkActionState(action, state);

        WebKitContextMenu* subMenu = webkit_context_menu_item_get_submenu(item);
        g_assert(WEBKIT_IS_CONTEXT_MENU(subMenu));
        if (subMenuIter)
            *subMenuIter = webkit_context_menu_get_items(subMenu);

        return g_list_next(items);
    }