Changeset 76092 in webkit


Ignore:
Timestamp:
Jan 18, 2011 7:16:35 PM (13 years ago)
Author:
mjs@apple.com
Message:

2011-01-18 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam Weinig.

WebKitTestRunner should track loading more like DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=52692

Change load tracking to track the current top loading frame, in the manner of DumpRenderTree.
This makes some tests that call notifyDone multiple times pass.


  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::InjectedBundle): (WTR::InjectedBundle::done):
  • WebKitTestRunner/InjectedBundle/InjectedBundle.h: (WTR::InjectedBundle::topLoadingFrame): (WTR::InjectedBundle::setTopLoadingFrame):
  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::InjectedBundlePage): (WTR::InjectedBundlePage::stopLoading): (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame): (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame): (WTR::InjectedBundlePage::didFinishLoadForFrame): (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
  • WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: (WTR::LayoutTestController::notifyDone):
  • WebKitTestRunner/TestController.cpp: (WTR::TestController::didReceiveMessageFromInjectedBundle):

2011-01-18 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam Weinig.

WebKitTestRunner should track loading more like DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=52692


Relax the message check in didSaveFrameToPageCache a bit more, since
layout tests were still hitting the old one.

  • UIProcess/WebPageProxy.cpp: (WebKit::isDisconnectedFrame): (WebKit::WebPageProxy::didSaveFrameToPageCache):
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/editing/pasteboard/copy-null-characters.html

    r75861 r76092  
    1919    sel.setPosition(destinationRichText, 0);
    2020    document.execCommand("Paste");
     21    alert(destinationRichText.innerHTML);
    2122
    2223    var destinationPlainText = document.getElementById("destination-plain-text");
     
    3031            JSON.stringify(expectedPlainTextValue) + " but found " +
    3132            JSON.stringify(destinationPlainText.value) + ").";
     33        Markup.dump(document.body);
     34        Markup.notifyDone();
    3235        return;
    3336    }
     
    5356            JSON.stringify(expectedPlainTextValue2) + " but found " +
    5457            JSON.stringify(destinationPlainText.value) + ").";
     58        Markup.dump(document.body);
     59        Markup.notifyDone();
    5560        return;
    5661    }
  • trunk/LayoutTests/fast/events/scroll-event-does-not-bubble.html

    r75555 r76092  
    1515    // Don't call notifyDone straight away, in case there's another scroll event coming/bubbling.
    1616    doneTimeout = setTimeout(function() {
     17
     18        // Don't pollute the test result with nonsense.
     19        document.getElementById('container').innerHTML = '';
    1720        if (window.layoutTestController)
    1821            layoutTestController.notifyDone();
     
    3336    window.onscroll = windowScrolled;
    3437    div.scrollByLines(1);
    35    
    36     // Don't pollute the test result with nonsense.
    37     div.innerHTML = '';
    3838}
    3939
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r75934 r76092  
    977977# WebKit2 needs layoutTestController.overridePreference
    978978# <https://bugs.webkit.org/show_bug.cgi?id=42197>
     979http/tests/navigation/go-back-to-error-page.html
    979980http/tests/navigation/ping-cookie.html
    980981plugins/application-plugin-plugins-disabled.html
     
    10851086# Pasteboard doesn't work in WebKit2
    10861087# <https://bugs.webkit.org/show_bug.cgi?id=42317>
     1088editing/pasteboard/copy-null-characters.html
    10871089editing/execCommand/4128080-2.html
    10881090editing/execCommand/5939887.html
     
    23342336http/tests/local/link-stylesheet-load-order.html
    23352337http/tests/local/link-stylesheet-load-order-preload.html
     2338
     2339
     2340# Transitions sometimes don't stop when they should
     2341transitions/hang-with-bad-transition-list.html
     2342transitions/remove-transition-style.html
     2343transitions/repeated-firing-background-color.html
     2344transitions/zero-duration-with-non-zero-delay-end.html
     2345
     2346
     2347# CSSValue and CSSPrimitiveValue prototypes are wrong
     2348fast/dom/global-constructors.html
     2349
     2350# WebKit2 doesn't support tiled layers
     2351compositing/tiling/huge-layer-resize.html
     2352
     2353# Unexplained plugin failures
     2354plugins/destroy-reentry.html
     2355platform/mac/plugins/testplugin-onnew-onpaint.html
     2356plugins/destroy-stream-twice.html
     2357plugins/embed-inside-object.html
     2358plugins/no-mime-with-valid-extension.html
  • trunk/LayoutTests/transitions/remove-transition-style.html

    r42410 r76092  
    5252    {
    5353      var box = document.getElementById('box');
     54      box.addEventListener("webkitTransitionEnd", function() { alert("end"); }, false);
    5455      box.className = 'animated';
    5556      window.setTimeout(function() {
  • trunk/Source/WebKit2/ChangeLog

    r76089 r76092  
     12011-01-18  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        WebKitTestRunner should track loading more like DumpRenderTree
     6        https://bugs.webkit.org/show_bug.cgi?id=52692
     7       
     8        Relax the message check in didSaveFrameToPageCache a bit more, since
     9        layout tests were still hitting the old one.
     10
     11        * UIProcess/WebPageProxy.cpp:
     12        (WebKit::isDisconnectedFrame):
     13        (WebKit::WebPageProxy::didSaveFrameToPageCache):
     14
    1152011-01-18  Brady Eidson  <beidson@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r76089 r76092  
    10831083}
    10841084
     1085static bool isDisconnectedFrame(WebFrameProxy* frame)
     1086{
     1087    return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
     1088}
     1089
    10851090void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
    10861091{
     
    10901095    MESSAGE_CHECK(subframe);
    10911096
    1092     if (!subframe->parentFrame())
     1097    if (isDisconnectedFrame(subframe))
    10931098        return;
    10941099
  • trunk/Tools/ChangeLog

    r76081 r76092  
     12011-01-18  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        WebKitTestRunner should track loading more like DumpRenderTree
     6        https://bugs.webkit.org/show_bug.cgi?id=52692
     7
     8        Change load tracking to track the current top loading frame, in the manner of DumpRenderTree.
     9        This makes some tests that call notifyDone multiple times pass.
     10       
     11        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
     12        (WTR::InjectedBundle::InjectedBundle):
     13        (WTR::InjectedBundle::done):
     14        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
     15        (WTR::InjectedBundle::topLoadingFrame):
     16        (WTR::InjectedBundle::setTopLoadingFrame):
     17        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     18        (WTR::InjectedBundlePage::InjectedBundlePage):
     19        (WTR::InjectedBundlePage::stopLoading):
     20        (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
     21        (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
     22        (WTR::InjectedBundlePage::didFinishLoadForFrame):
     23        (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
     24        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
     25        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
     26        (WTR::LayoutTestController::notifyDone):
     27        * WebKitTestRunner/TestController.cpp:
     28        (WTR::TestController::didReceiveMessageFromInjectedBundle):
     29
    1302011-01-18  Mihai Parparita  <mihaip@chromium.org>
    231
  • trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm

    r73938 r76092  
    267267void LayoutTestController::notifyDone()
    268268{
     269    puts("notifyDone");
     270
    269271    if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())
    270272        dump();
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r75587 r76092  
    4848InjectedBundle::InjectedBundle()
    4949    : m_bundle(0)
     50    , m_topLoadingFrame(0)
    5051    , m_state(Idle)
    5152{
     
    162163
    163164    page()->stopLoading();
     165    setTopLoadingFrame(0);
    164166
    165167    WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("Done"));
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h

    r73066 r76092  
    6666    bool isTestRunning() { return m_state == Testing; }
    6767
     68    WKBundleFrameRef topLoadingFrame() { return m_topLoadingFrame; }
     69    void setTopLoadingFrame(WKBundleFrameRef frame) { m_topLoadingFrame = frame; }
     70
    6871private:
    6972    InjectedBundle();
     
    9093    RefPtr<EventSendingController> m_eventSendingController;
    9194
     95    WKBundleFrameRef m_topLoadingFrame;
     96
    9297    std::ostringstream m_outputStream;
    9398   
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r75826 r76092  
    3838#include <WebKit2/WKBundlePagePrivate.h>
    3939
     40#include <WebKit2/WKStringCF.h>
     41
    4042using namespace std;
    4143
     
    169171    : m_page(page)
    170172    , m_world(AdoptWK, WKBundleScriptWorldCreateWorld())
    171     , m_isLoading(false)
    172173{
    173174    WKBundlePageLoaderClient loaderClient = {
     
    234235{
    235236    WKBundlePageStopLoading(m_page);
    236     m_isLoading = false;
    237237}
    238238
     
    335335        return;
    336336
    337     if (frame == WKBundlePageGetMainFrame(m_page))
    338         m_isLoading = true;
     337    if (InjectedBundle::shared().topLoadingFrame())
     338        return;
     339    InjectedBundle::shared().setTopLoadingFrame(frame);
    339340}
    340341
     
    345346void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef frame, WKErrorRef error)
    346347{
     348    if (!InjectedBundle::shared().isTestRunning())
     349        return;
     350
     351    if (frame != InjectedBundle::shared().topLoadingFrame())
     352        return;
     353    InjectedBundle::shared().setTopLoadingFrame(0);
     354
     355    if (InjectedBundle::shared().layoutTestController()->waitToDump())
     356        return;
     357
     358    InjectedBundle::shared().done();
    347359}
    348360
     
    476488        return;
    477489
    478     if (!WKBundleFrameIsMainFrame(frame))
    479         return;
    480 
    481     m_isLoading = false;
    482 
    483     if (this != InjectedBundle::shared().page())
    484         return;
     490    if (frame != InjectedBundle::shared().topLoadingFrame())
     491        return;
     492    InjectedBundle::shared().setTopLoadingFrame(0);
    485493
    486494    if (InjectedBundle::shared().layoutTestController()->waitToDump())
    487495        return;
    488496
    489     dump();
     497    InjectedBundle::shared().page()->dump();
    490498}
    491499
     
    495503        return;
    496504
    497     if (!WKBundleFrameIsMainFrame(frame))
    498         return;
    499 
    500     m_isLoading = false;
    501 
    502     if (this != InjectedBundle::shared().page())
     505    if (frame != InjectedBundle::shared().topLoadingFrame())
     506        return;
     507    InjectedBundle::shared().setTopLoadingFrame(0);
     508
     509    if (InjectedBundle::shared().layoutTestController()->waitToDump())
    503510        return;
    504511
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h

    r75826 r76092  
    4242
    4343    void stopLoading();
    44     bool isLoading() { return m_isLoading; }
    4544
    4645    void reset();
     
    125124    WKRetainPtr<WKBundleScriptWorldRef> m_world;
    126125    WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem;
    127     bool m_isLoading;
    128126};
    129127
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp

    r75291 r76092  
    133133        return;
    134134
    135     if (m_waitToDump && !InjectedBundle::shared().page()->isLoading())
     135    if (m_waitToDump && !InjectedBundle::shared().topLoadingFrame())
    136136        InjectedBundle::shared().page()->dump();
     137
    137138    m_waitToDump = false;
    138139}
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r75682 r76092  
    387387void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
    388388{
     389    if (!m_currentInvocation)
     390        return;
    389391    m_currentInvocation->didReceiveMessageFromInjectedBundle(messageName, messageBody);
    390392}
Note: See TracChangeset for help on using the changeset viewer.