Changeset 105688 in webkit


Ignore:
Timestamp:
Jan 23, 2012 8:40:30 PM (12 years ago)
Author:
Martin Robinson
Message:

[GTK][WK2] Make the LoadTracking and WebView test fixtures more flexible
https://bugs.webkit.org/show_bug.cgi?id=76755

Reviewed by Alejandro G. Castro.

Always clear the loading events when loading new content in the load tracking
test. In the WebView test correctly handle loading HTML with a URL that isn't
"about:blank."

  • UIProcess/API/gtk/tests/LoadTrackingTest.cpp:

(LoadTrackingTest::loadURI): Reset the class state when starting a new load.
(LoadTrackingTest::loadHtml): Ditto.
(LoadTrackingTest::loadPlainText): Ditto.
(LoadTrackingTest::loadRequest): Ditto.

  • UIProcess/API/gtk/tests/LoadTrackingTest.h: Added new method definitions.
  • UIProcess/API/gtk/tests/TestWebKitWebLoaderClient.cpp:

(assertNormalLoadHappened): No longer clear loading events. The fixture handles that now.
(testLoadHtml): Update to reflect new method name.
(testLoadPlainText): Ditto.
(testLoadRequest): Ditto.
(testWebViewReload): Ditto.

  • UIProcess/API/gtk/tests/WebViewTest.cpp:

(WebViewTest::loadHtml): Properly interpret the baseURL parameter.

  • UIProcess/API/gtk/tests/WebViewTest.h: Make loading methods virtual.
Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r105670 r105688  
     12012-01-23  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [GTK][WK2] Make the LoadTracking and WebView test fixtures more flexible
     4        https://bugs.webkit.org/show_bug.cgi?id=76755
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        Always clear the loading events when loading new content in the load tracking
     9        test. In the WebView test correctly handle loading HTML with a URL that isn't
     10        "about:blank."
     11
     12        * UIProcess/API/gtk/tests/LoadTrackingTest.cpp:
     13        (LoadTrackingTest::loadURI): Reset the class state when starting a new load.
     14        (LoadTrackingTest::loadHtml): Ditto.
     15        (LoadTrackingTest::loadPlainText): Ditto.
     16        (LoadTrackingTest::loadRequest): Ditto.
     17        * UIProcess/API/gtk/tests/LoadTrackingTest.h: Added new method definitions.
     18        * UIProcess/API/gtk/tests/TestWebKitWebLoaderClient.cpp:
     19        (assertNormalLoadHappened): No longer clear loading events. The fixture handles that now.
     20        (testLoadHtml): Update to reflect new method name.
     21        (testLoadPlainText): Ditto.
     22        (testLoadRequest): Ditto.
     23        (testWebViewReload): Ditto.
     24        * UIProcess/API/gtk/tests/WebViewTest.cpp:
     25        (WebViewTest::loadHtml): Properly interpret the baseURL parameter.
     26        * UIProcess/API/gtk/tests/WebViewTest.h: Make loading methods virtual.
     27
    1282012-01-23  Alexander Færøy  <alexander.faeroy@nokia.com>
    229
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/LoadTrackingTest.cpp

    r103938 r105688  
    139139}
    140140
     141void LoadTrackingTest::loadURI(const char* uri)
     142{
     143    m_loadEvents.clear();
     144    m_estimatedProgress = 0;
     145    WebViewTest::loadURI(uri);
     146}
     147
     148void LoadTrackingTest::loadHtml(const char* html, const char* baseURI)
     149{
     150    m_loadEvents.clear();
     151    m_estimatedProgress = 0;
     152    WebViewTest::loadHtml(html, baseURI);
     153}
     154
     155void LoadTrackingTest::loadPlainText(const char* plainText)
     156{
     157    m_loadEvents.clear();
     158    m_estimatedProgress = 0;
     159    WebViewTest::loadPlainText(plainText);
     160}
     161
     162void LoadTrackingTest::loadRequest(WebKitURIRequest* request)
     163{
     164    m_loadEvents.clear();
     165    m_estimatedProgress = 0;
     166    WebViewTest::loadRequest(request);
     167}
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/LoadTrackingTest.h

    r103938 r105688  
    4040    virtual void estimatedProgressChanged();
    4141
     42    void loadURI(const char* uri);
     43    void loadHtml(const char* html, const char* baseURI);
     44    void loadPlainText(const char* plainText);
     45    void loadRequest(WebKitURIRequest*);
     46
    4247    void setRedirectURI(const char* uri) { m_redirectURI = uri; }
    4348
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebLoaderClient.cpp

    r104129 r105688  
    5656}
    5757
    58 static void assertNormalLoadHappenedAndClearEvents(Vector<LoadTrackingTest::LoadEvents>& events)
     58static void assertNormalLoadHappened(Vector<LoadTrackingTest::LoadEvents>& events)
    5959{
    6060    g_assert_cmpint(events.size(), ==, 3);
     
    6262    g_assert_cmpint(events[1], ==, LoadTrackingTest::LoadCommitted);
    6363    g_assert_cmpint(events[2], ==, LoadTrackingTest::LoadFinished);
    64     events.clear();
    6564}
    6665
     
    6968    test->loadHtml("<html><body>Hello WebKit-GTK+</body></html>", 0);
    7069    test->waitUntilLoadFinished();
    71     assertNormalLoadHappenedAndClearEvents(test->m_loadEvents);
     70    assertNormalLoadHappened(test->m_loadEvents);
    7271}
    7372
     
    7675    test->loadPlainText("Hello WebKit-GTK+");
    7776    test->waitUntilLoadFinished();
    78     assertNormalLoadHappenedAndClearEvents(test->m_loadEvents);
     77    assertNormalLoadHappened(test->m_loadEvents);
    7978}
    8079
     
    8483    test->loadRequest(request.get());
    8584    test->waitUntilLoadFinished();
    86     assertNormalLoadHappenedAndClearEvents(test->m_loadEvents);
     85    assertNormalLoadHappened(test->m_loadEvents);
    8786}
    8887
     
    132131    test->loadURI(kServer->getURIForPath("/normal").data());
    133132    test->waitUntilLoadFinished();
    134     assertNormalLoadHappenedAndClearEvents(test->m_loadEvents);
     133    assertNormalLoadHappened(test->m_loadEvents);
    135134
    136135    webkit_web_view_reload(test->m_webView);
    137136    test->waitUntilLoadFinished();
    138     assertNormalLoadHappenedAndClearEvents(test->m_loadEvents);
     137    assertNormalLoadHappened(test->m_loadEvents);
    139138}
    140139
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp

    r104129 r105688  
    4949void WebViewTest::loadHtml(const char* html, const char* baseURI)
    5050{
    51     m_activeURI = "about:blank";
     51    if (!baseURI)
     52        m_activeURI = "about:blank";
     53    else
     54        m_activeURI = baseURI;
    5255    webkit_web_view_load_html(m_webView, html, baseURI);
    5356}
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h

    r104129 r105688  
    3232    virtual ~WebViewTest();
    3333
    34     void loadURI(const char* uri);
    35     void loadHtml(const char* html, const char* baseURI);
    36     void loadPlainText(const char* plainText);
    37     void loadRequest(WebKitURIRequest*);
     34    virtual void loadURI(const char* uri);
     35    virtual void loadHtml(const char* html, const char* baseURI);
     36    virtual void loadPlainText(const char* plainText);
     37    virtual void loadRequest(WebKitURIRequest*);
    3838    void replaceContent(const char* html, const char* contentURI, const char* baseURI);
    3939    void goBack();
Note: See TracChangeset for help on using the changeset viewer.