Changeset 50621 in webkit


Ignore:
Timestamp:
Nov 8, 2009 9:25:31 AM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

[Qt][DRT] Replace queueScript by queueNonLoadingScript and queueLoadingScript method
https://bugs.webkit.org/show_bug.cgi?id=31158

Patch by Antonio Gomes <tonikitoo@webkit.org> on 2009-11-07
Reviewed by Holger Freyther.

By invoking a script queue'd by queueScript(), 'true' was beeing returned
always, which from WorkQueue prospective means that a load has been started
and the queue processing should stop and wait for the load to finish.
Spinning it off into a loading and a non-loading variants was the solution
adopted by Mac's DRT to work around this problem. The former keeps returning
'true' while the later executes the script synchronously and returns 'false'
making it possible to the WorkQueue to proceed right away.

  • DumpRenderTree/qt/LayoutTestControllerQt.cpp:

(LayoutTestController::processWork):
(LayoutTestController::queueLoadingScript):
(LayoutTestController::queueNonLoadingScript):

  • DumpRenderTree/qt/LayoutTestControllerQt.h:
  • DumpRenderTree/qt/WorkQueueItem.h:

(LoadingScriptItem::LoadingScriptItem):
(LoadingScriptItem::invoke):
(NonLoadingScriptItem::NonLoadingScriptItem):
(NonLoadingScriptItem::invoke):

Location:
trunk/WebKitTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r50620 r50621  
     12009-11-07  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Holger Freyther.
     4
     5        [Qt][DRT] Replace queueScript by queueNonLoadingScript and queueLoadingScript method
     6        https://bugs.webkit.org/show_bug.cgi?id=31158
     7
     8        By invoking a script queue'd by queueScript(), 'true' was beeing returned
     9        always, which from WorkQueue prospective means that a load has been started
     10        and the queue processing should stop and wait for the load to finish.
     11        Spinning it off into a loading and a non-loading variants was the solution
     12        adopted by Mac's DRT to work around this problem. The former keeps returning
     13        'true' while the later executes the script synchronously and returns 'false'
     14        making it possible to the WorkQueue to proceed right away.
     15
     16        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     17        (LayoutTestController::processWork):
     18        (LayoutTestController::queueLoadingScript):
     19        (LayoutTestController::queueNonLoadingScript):
     20        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     21        * DumpRenderTree/qt/WorkQueueItem.h:
     22        (LoadingScriptItem::LoadingScriptItem):
     23        (LoadingScriptItem::invoke):
     24        (NonLoadingScriptItem::NonLoadingScriptItem):
     25        (NonLoadingScriptItem::invoke):
     26
    1272009-11-07  Mark Rowe  <mrowe@apple.com>
    228
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r50289 r50621  
    187187}
    188188
    189 void LayoutTestController::queueScript(const QString &url)
    190 {
    191     //qDebug() << ">>>queueScript" << url;
    192     WorkQueue::shared()->queue(new ScriptItem(url, m_drt->webPage()));
     189void LayoutTestController::queueLoadingScript(const QString& script)
     190{
     191    //qDebug() << ">>>queueLoadingScript" << script;
     192    WorkQueue::shared()->queue(new LoadingScriptItem(script, m_drt->webPage()));
     193}
     194
     195void LayoutTestController::queueNonLoadingScript(const QString& script)
     196{
     197    //qDebug() << ">>>queueNonLoadingScript" << script;
     198    WorkQueue::shared()->queue(new NonLoadingScriptItem(script, m_drt->webPage()));
    193199}
    194200
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r50289 r50621  
    9494    void queueLoad(const QString& url, const QString& target = QString());
    9595    void queueReload();
    96     void queueScript(const QString& url);
     96    void queueLoadingScript(const QString& script);
     97    void queueNonLoadingScript(const QString& script);
    9798    void provisionalLoad();
    9899    void setCloseRemainingWindowsWhenComplete(bool = false) {}
  • trunk/WebKitTools/DumpRenderTree/qt/WorkQueueItem.h

    r49519 r50621  
    9090};
    9191
     92class LoadingScriptItem : public ScriptItem {
     93public:
     94    LoadingScriptItem(const QString& script, QWebPage* page)
     95        : ScriptItem(script, page)
     96    {
     97    }
     98
     99    virtual bool invoke() const { return ScriptItem::invoke(); }
     100};
     101
     102class NonLoadingScriptItem : public ScriptItem {
     103public:
     104    NonLoadingScriptItem(const QString& script, QWebPage* page)
     105        : ScriptItem(script, page)
     106    {
     107    }
     108
     109    virtual bool invoke() const { ScriptItem::invoke(); return false; }
     110};
     111
     112
    92113class BackForwardItem : public WorkQueueItem {
    93114public:
Note: See TracChangeset for help on using the changeset viewer.