Changeset 70470 in webkit


Ignore:
Timestamp:
Oct 25, 2010 12:03:08 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-25 Johnny Ding <jnd@chromium.org>

Reviewed by Tony Chang.

Dump the gesture status of frame in frame load callbacks in DumpRenderTree
by adding a new method dumpUserGestureInFrameLoadCallbacks.
Now only dump the gesture status in "DidStartProvisionalLoad" callback.
https://bugs.webkit.org/show_bug.cgi?id=47849

  • WebCoreSupport/DumpRenderTreeSupportQt.cpp: (DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader):
  • WebCoreSupport/DumpRenderTreeSupportQt.h:
  • WebCoreSupport/FrameLoaderClientQt.cpp: (drtPrintFrameUserGestureStatus): (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents): (WebCore::FrameLoaderClientQt::dispatchDidPushStateWithinPage): (WebCore::FrameLoaderClientQt::dispatchDidReplaceStateWithinPage): (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage): (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
  • WebCoreSupport/FrameLoaderClientQt.h:

2010-10-25 Johnny Ding <jnd@chromium.org>

Reviewed by Tony Chang.

Dump the gesture status of frame in frame load callbacks in DumpRenderTree
by adding a new method dumpUserGestureInFrameLoadCallbacks.
Now only dump the gesture status in "DidStartProvisionalLoad" callback.
https://bugs.webkit.org/show_bug.cgi?id=47849

  • DumpRenderTree/LayoutTestController.cpp: (LayoutTestController::LayoutTestController): (dumpUserGestureInFrameLoadCallbacksCallback): (LayoutTestController::staticFunctions):
  • DumpRenderTree/LayoutTestController.h: (LayoutTestController::dumpUserGestureInFrameLoadCallbacks): (LayoutTestController::setDumpUserGestureInFrameLoadCallbacks):
  • DumpRenderTree/chromium/LayoutTestController.cpp: (LayoutTestController::LayoutTestController): (LayoutTestController::dumpUserGestureInFrameLoadCallbacks): (LayoutTestController::reset):
  • DumpRenderTree/chromium/LayoutTestController.h: (LayoutTestController::shouldDumpUserGestureInFrameLoadCallbacks): (LayoutTestController::setShouldDumpUserGestureInFrameLoadCallbacks):
  • DumpRenderTree/chromium/TestShell.h: (TestShell::shouldDumpUserGestureInFrameLoadCallbacks):
  • DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::didStartProvisionalLoad): (WebViewHost::printFrameUserGestureStatus):
  • DumpRenderTree/chromium/WebViewHost.h:
  • DumpRenderTree/mac/FrameLoadDelegate.mm: (-[WebFrame _drt_printFrameUserGestureStatus]): (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): (-[FrameLoadDelegate webView:didCommitLoadForFrame:]): (-[FrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]): (-[FrameLoadDelegate webView:didFinishLoadForFrame:]): (-[FrameLoadDelegate webView:didFailLoadWithError:forFrame:]): (-[FrameLoadDelegate webView:windowScriptObjectAvailable:]): (-[FrameLoadDelegate webView:didReceiveTitle:forFrame:]):
  • DumpRenderTree/qt/LayoutTestControllerQt.cpp: (LayoutTestController::reset): (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
  • DumpRenderTree/qt/LayoutTestControllerQt.h:
Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/ChangeLog

    r70333 r70470  
     12010-10-25  Johnny Ding  <jnd@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        Dump the gesture status of frame in frame load callbacks in DumpRenderTree
     6        by adding a new method dumpUserGestureInFrameLoadCallbacks.
     7        Now only dump the gesture status in "DidStartProvisionalLoad" callback.
     8        https://bugs.webkit.org/show_bug.cgi?id=47849
     9
     10        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     11        (DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader):
     12        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     13        * WebCoreSupport/FrameLoaderClientQt.cpp:
     14        (drtPrintFrameUserGestureStatus):
     15        (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
     16        (WebCore::FrameLoaderClientQt::dispatchDidPushStateWithinPage):
     17        (WebCore::FrameLoaderClientQt::dispatchDidReplaceStateWithinPage):
     18        (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage):
     19        (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
     20        * WebCoreSupport/FrameLoaderClientQt.h:
     21
    1222010-10-22  Sam Weinig  <sam@webkit.org>
    223
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r69312 r70470  
    562562}
    563563
     564void DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(bool b)
     565{
     566    FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = b;
     567}
     568
    564569void DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(bool b)
    565570{
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r68825 r70470  
    102102
    103103    static void dumpFrameLoader(bool b);
     104    static void dumpUserGestureInFrameLoader(bool b);
    104105    static void dumpResourceLoadCallbacks(bool b);
    105106    static void dumpResourceResponseMIMETypes(bool b);
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r70333 r70470  
    107107}
    108108
     109static QString drtPrintFrameUserGestureStatus(WebCore::Frame* frame)
     110{
     111    if (frame->loader()->isProcessingUserGesture())
     112        return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("true"));
     113    return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("false"));
     114}
     115
    109116static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url)
    110117{
     
    160167
    161168bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false;
     169bool FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = false;
    162170bool FrameLoaderClientQt::dumpResourceLoadCallbacks = false;
    163171bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false;
     
    315323    if (dumpFrameLoaderCallbacks)
    316324        printf("%s - didHandleOnloadEventsForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
    317 
    318325}
    319326
     
    374381    if (dumpFrameLoaderCallbacks)
    375382        printf("%s - dispatchDidPushStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
    376        
     383
    377384    notImplemented();
    378385}
     
    382389    if (dumpFrameLoaderCallbacks)
    383390        printf("%s - dispatchDidReplaceStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
    384        
     391
    385392    notImplemented();
    386393}
     
    390397    if (dumpFrameLoaderCallbacks)
    391398        printf("%s - dispatchDidPopStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
    392        
     399
    393400    notImplemented();
    394401}
     
    403410    if (dumpFrameLoaderCallbacks)
    404411        printf("%s - didStartProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
     412
     413    if (dumpUserGestureInFrameLoaderCallbacks)
     414        printf("%s - in didStartProvisionalLoadForFrame\n", qPrintable(drtPrintFrameUserGestureStatus(m_frame)));
    405415
    406416    if (m_webFrame)
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h

    r70333 r70470  
    234234
    235235    static bool dumpFrameLoaderCallbacks;
     236    static bool dumpUserGestureInFrameLoaderCallbacks;
    236237    static bool dumpResourceLoadCallbacks;
    237238    static bool dumpResourceResponseMIMETypes;
  • trunk/WebKitTools/ChangeLog

    r70458 r70470  
     12010-10-25  Johnny Ding  <jnd@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        Dump the gesture status of frame in frame load callbacks in DumpRenderTree
     6        by adding a new method dumpUserGestureInFrameLoadCallbacks.
     7        Now only dump the gesture status in "DidStartProvisionalLoad" callback.
     8        https://bugs.webkit.org/show_bug.cgi?id=47849
     9
     10        * DumpRenderTree/LayoutTestController.cpp:
     11        (LayoutTestController::LayoutTestController):
     12        (dumpUserGestureInFrameLoadCallbacksCallback):
     13        (LayoutTestController::staticFunctions):
     14        * DumpRenderTree/LayoutTestController.h:
     15        (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
     16        (LayoutTestController::setDumpUserGestureInFrameLoadCallbacks):
     17        * DumpRenderTree/chromium/LayoutTestController.cpp:
     18        (LayoutTestController::LayoutTestController):
     19        (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
     20        (LayoutTestController::reset):
     21        * DumpRenderTree/chromium/LayoutTestController.h:
     22        (LayoutTestController::shouldDumpUserGestureInFrameLoadCallbacks):
     23        (LayoutTestController::setShouldDumpUserGestureInFrameLoadCallbacks):
     24        * DumpRenderTree/chromium/TestShell.h:
     25        (TestShell::shouldDumpUserGestureInFrameLoadCallbacks):
     26        * DumpRenderTree/chromium/WebViewHost.cpp:
     27        (WebViewHost::didStartProvisionalLoad):
     28        (WebViewHost::printFrameUserGestureStatus):
     29        * DumpRenderTree/chromium/WebViewHost.h:
     30        * DumpRenderTree/mac/FrameLoadDelegate.mm:
     31        (-[WebFrame _drt_printFrameUserGestureStatus]):
     32        (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]):
     33        (-[FrameLoadDelegate webView:didCommitLoadForFrame:]):
     34        (-[FrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
     35        (-[FrameLoadDelegate webView:didFinishLoadForFrame:]):
     36        (-[FrameLoadDelegate webView:didFailLoadWithError:forFrame:]):
     37        (-[FrameLoadDelegate webView:windowScriptObjectAvailable:]):
     38        (-[FrameLoadDelegate webView:didReceiveTitle:forFrame:]):
     39        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     40        (LayoutTestController::reset):
     41        (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
     42        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     43
    1442010-10-25  Sheriff Bot  <webkit.review.bot@gmail.com>
    245
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp

    r70385 r70470  
    5252    , m_dumpEditingCallbacks(false)
    5353    , m_dumpFrameLoadCallbacks(false)
     54    , m_dumpUserGestureInFrameLoadCallbacks(false)
    5455    , m_dumpHistoryDelegateCallbacks(false)
    5556    , m_dumpResourceLoadCallbacks(false)
     
    165166    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
    166167    controller->setDumpFrameLoadCallbacks(true);
     168    return JSValueMakeUndefined(context);
     169}
     170
     171static JSValueRef dumpUserGestureInFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     172{
     173    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
     174    controller->setDumpUserGestureInFrameLoadCallbacks(true);
    167175    return JSValueMakeUndefined(context);
    168176}
     
    18901898        { "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    18911899        { "dumpFrameLoadCallbacks", dumpFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     1900        { "dumpUserGestureInFrameLoadCallbacks", dumpUserGestureInFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },       
    18921901        { "dumpResourceLoadCallbacks", dumpResourceLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    18931902        { "dumpResourceResponseMIMETypes", dumpResourceResponseMIMETypesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.h

    r70385 r70470  
    155155    bool dumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
    156156    void setDumpFrameLoadCallbacks(bool dumpFrameLoadCallbacks) { m_dumpFrameLoadCallbacks = dumpFrameLoadCallbacks; }
     157   
     158    bool dumpUserGestureInFrameLoadCallbacks() const { return m_dumpUserGestureInFrameLoadCallbacks; }
     159    void setDumpUserGestureInFrameLoadCallbacks(bool dumpUserGestureInFrameLoadCallbacks) { m_dumpUserGestureInFrameLoadCallbacks = dumpUserGestureInFrameLoadCallbacks; }   
    157160
    158161    bool dumpHistoryDelegateCallbacks() const { return m_dumpHistoryDelegateCallbacks; }
     
    312315    bool m_dumpEditingCallbacks;
    313316    bool m_dumpFrameLoadCallbacks;
     317    bool m_dumpUserGestureInFrameLoadCallbacks;
    314318    bool m_dumpHistoryDelegateCallbacks;
    315319    bool m_dumpResourceLoadCallbacks;
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp

    r70302 r70470  
    9595    bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
    9696    bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
     97    bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks);
    9798    bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
    9899    bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes);
     
    289290}
    290291
     292void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
     293{
     294    m_dumpUserGestureInFrameLoadCallbacks = true;
     295    result->setNull();
     296}
     297
    291298void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result)
    292299{
     
    523530    m_dumpEditingCallbacks = false;
    524531    m_dumpFrameLoadCallbacks = false;
     532    m_dumpUserGestureInFrameLoadCallbacks = false;
    525533    m_dumpResourceLoadCallbacks = false;
    526534    m_dumpResourceResponseMIMETypes = false;
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h

    r70064 r70470  
    8989    void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
    9090
     91    // This function sets a flag that tells the test_shell to print a line of
     92    // user gesture status text for some frame load callbacks.  It takes no
     93    // arguments, and ignores any that may be present.
     94    void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
     95
    9196    // This function sets a flag that tells the test_shell to print out a text
    9297    // representation of the back/forward list.  It ignores all arguments.
     
    341346    bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
    342347    void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
     348    bool shouldDumpUserGestureInFrameLoadCallbacks() { return m_dumpUserGestureInFrameLoadCallbacks; }
     349    void setShouldDumpUserGestureInFrameLoadCallbacks(bool value) { m_dumpUserGestureInFrameLoadCallbacks = value; }
    343350    bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
    344351    void setShouldDumpResourceResponseMIMETypes(bool value) { m_dumpResourceResponseMIMETypes = value; }
     
    461468    bool m_dumpFrameLoadCallbacks;
    462469
     470    // If true, the test_shell will output a line of the user gesture status
     471    // text for some frame load callbacks.
     472    bool m_dumpUserGestureInFrameLoadCallbacks;
     473
    463474    // If true, the test_shell will output a descriptive line for each resource
    464475    // load callback.
  • trunk/WebKitTools/DumpRenderTree/chromium/TestShell.h

    r68801 r70470  
    110110    void setFocus(WebKit::WebWidget*, bool enable);
    111111    bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); }
     112    bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpUserGestureInFrameLoadCallbacks(); }
    112113    bool shouldDumpResourceLoadCallbacks() const  { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); }
    113114    bool shouldDumpResourceResponseMIMETypes() const  { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); }
  • trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp

    r70064 r70470  
    814814void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
    815815{
     816    if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())
     817        printFrameUserGestureStatus(frame, " - in didStartProvisionalLoadForFrame\n");
    816818    if (m_shell->shouldDumpFrameLoadCallbacks()) {
    817819        printFrameDescription(frame);
     
    13061308}
    13071309
     1310void WebViewHost::printFrameUserGestureStatus(WebFrame* webframe, const char* msg)
     1311{
     1312    bool isUserGesture = webframe->isProcessingUserGesture();
     1313    printf("Frame with user gesture \"%s\"%s", isUserGesture ? "true" : "false", msg);
     1314}
     1315
    13081316void WebViewHost::printResourceDescription(unsigned identifier)
    13091317{
  • trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.h

    r70064 r70470  
    221221    void printFrameDescription(WebKit::WebFrame*);
    222222
     223    // Dumping the user gesture status to the console.
     224    void printFrameUserGestureStatus(WebKit::WebFrame*, const char*);
     225
    223226    bool hasWindow() const { return m_hasWindow; }
    224227    void resetScrollRect();
  • trunk/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm

    r50973 r70470  
    5151#import <WebKit/WebScriptWorld.h>
    5252#import <WebKit/WebSecurityOriginPrivate.h>
     53#import <WebKit/WebViewPrivate.h>
    5354#import <wtf/Assertions.h>
    5455
     
    9091    }
    9192}
     93
     94- (NSString *)_drt_printFrameUserGestureStatus
     95{
     96    BOOL isUserGesture = [[self webView] _isProcessingUserGesture];
     97    return [NSString stringWithFormat:@"Frame with user gesture \"%@\"", isUserGesture ? @"true" : @"false"];
     98}
    9299@end
    93100
     
    147154        printf ("%s\n", [string UTF8String]);
    148155    }
    149    
     156
     157    if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) {
     158        NSString *string = [NSString stringWithFormat:@"%@ - in didStartProvisionalLoadForFrame", [frame _drt_printFrameUserGestureStatus]];
     159        printf ("%s\n", [string UTF8String]);
     160    }
     161
    150162    ASSERT([frame provisionalDataSource]);
    151163    // Make sure we only set this once per test.  If it gets cleared, and then set again, we might
     
    167179        printf ("%s\n", [string UTF8String]);
    168180    }
    169    
     181
    170182    ASSERT(![frame provisionalDataSource]);
    171183    ASSERT([frame dataSource]);
     
    191203        return;
    192204    }
    193    
     205
    194206    ASSERT([frame provisionalDataSource]);
    195207    [self webView:sender locationChangeDone:error forDataSource:[frame provisionalDataSource]];
     
    205217        printf ("%s\n", [string UTF8String]);
    206218    }
    207    
     219
    208220    // FIXME: This call to displayIfNeeded can be removed when <rdar://problem/5092361> is fixed.
    209221    // After that is fixed, we will reenable painting after WebCore is done loading the document,
     
    221233        printf ("%s\n", [string UTF8String]);
    222234    }
    223    
     235
    224236    ASSERT(![frame provisionalDataSource]);
    225237    ASSERT([frame dataSource]);
     
    234246        printf ("%s\n", [string UTF8String]);
    235247    }
    236    
     248
    237249    ASSERT_NOT_REACHED();
    238250}
     
    315327        printf ("%s\n", [string UTF8String]);
    316328    }
    317    
     329
    318330    if (gLayoutTestController->dumpTitleChanges())
    319331        printf("TITLE CHANGED: %s\n", [title UTF8String]);
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r70302 r70470  
    7474    DumpRenderTreeSupportQt::dumpEditingCallbacks(false);
    7575    DumpRenderTreeSupportQt::dumpFrameLoader(false);
     76    DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(false);
    7677    DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false);
    7778    DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(false);
     
    245246{
    246247    DumpRenderTreeSupportQt::dumpFrameLoader(true);
     248}
     249
     250void LayoutTestController::dumpUserGestureInFrameLoadCallbacks()
     251{
     252    DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true);
    247253}
    248254
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r70302 r70470  
    107107    void dumpEditingCallbacks();
    108108    void dumpFrameLoadCallbacks();
     109    void dumpUserGestureInFrameLoadCallbacks();
    109110    void dumpResourceLoadCallbacks();
    110111    void dumpResourceResponseMIMETypes();
Note: See TracChangeset for help on using the changeset viewer.