Changeset 70470 in webkit
- Timestamp:
- Oct 25, 2010 12:03:08 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/ChangeLog
r70333 r70470 1 2010-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 1 22 2010-10-22 Sam Weinig <sam@webkit.org> 2 23 -
trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r69312 r70470 562 562 } 563 563 564 void DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(bool b) 565 { 566 FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = b; 567 } 568 564 569 void DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(bool b) 565 570 { -
trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
r68825 r70470 102 102 103 103 static void dumpFrameLoader(bool b); 104 static void dumpUserGestureInFrameLoader(bool b); 104 105 static void dumpResourceLoadCallbacks(bool b); 105 106 static void dumpResourceResponseMIMETypes(bool b); -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r70333 r70470 107 107 } 108 108 109 static 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 109 116 static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url) 110 117 { … … 160 167 161 168 bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false; 169 bool FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = false; 162 170 bool FrameLoaderClientQt::dumpResourceLoadCallbacks = false; 163 171 bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false; … … 315 323 if (dumpFrameLoaderCallbacks) 316 324 printf("%s - didHandleOnloadEventsForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 317 318 325 } 319 326 … … 374 381 if (dumpFrameLoaderCallbacks) 375 382 printf("%s - dispatchDidPushStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 376 383 377 384 notImplemented(); 378 385 } … … 382 389 if (dumpFrameLoaderCallbacks) 383 390 printf("%s - dispatchDidReplaceStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 384 391 385 392 notImplemented(); 386 393 } … … 390 397 if (dumpFrameLoaderCallbacks) 391 398 printf("%s - dispatchDidPopStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 392 399 393 400 notImplemented(); 394 401 } … … 403 410 if (dumpFrameLoaderCallbacks) 404 411 printf("%s - didStartProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 412 413 if (dumpUserGestureInFrameLoaderCallbacks) 414 printf("%s - in didStartProvisionalLoadForFrame\n", qPrintable(drtPrintFrameUserGestureStatus(m_frame))); 405 415 406 416 if (m_webFrame) -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
r70333 r70470 234 234 235 235 static bool dumpFrameLoaderCallbacks; 236 static bool dumpUserGestureInFrameLoaderCallbacks; 236 237 static bool dumpResourceLoadCallbacks; 237 238 static bool dumpResourceResponseMIMETypes; -
trunk/WebKitTools/ChangeLog
r70458 r70470 1 2010-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 1 44 2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com> 2 45 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r70385 r70470 52 52 , m_dumpEditingCallbacks(false) 53 53 , m_dumpFrameLoadCallbacks(false) 54 , m_dumpUserGestureInFrameLoadCallbacks(false) 54 55 , m_dumpHistoryDelegateCallbacks(false) 55 56 , m_dumpResourceLoadCallbacks(false) … … 165 166 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 166 167 controller->setDumpFrameLoadCallbacks(true); 168 return JSValueMakeUndefined(context); 169 } 170 171 static 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); 167 175 return JSValueMakeUndefined(context); 168 176 } … … 1890 1898 { "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1891 1899 { "dumpFrameLoadCallbacks", dumpFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1900 { "dumpUserGestureInFrameLoadCallbacks", dumpUserGestureInFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1892 1901 { "dumpResourceLoadCallbacks", dumpResourceLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1893 1902 { "dumpResourceResponseMIMETypes", dumpResourceResponseMIMETypesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r70385 r70470 155 155 bool dumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; } 156 156 void setDumpFrameLoadCallbacks(bool dumpFrameLoadCallbacks) { m_dumpFrameLoadCallbacks = dumpFrameLoadCallbacks; } 157 158 bool dumpUserGestureInFrameLoadCallbacks() const { return m_dumpUserGestureInFrameLoadCallbacks; } 159 void setDumpUserGestureInFrameLoadCallbacks(bool dumpUserGestureInFrameLoadCallbacks) { m_dumpUserGestureInFrameLoadCallbacks = dumpUserGestureInFrameLoadCallbacks; } 157 160 158 161 bool dumpHistoryDelegateCallbacks() const { return m_dumpHistoryDelegateCallbacks; } … … 312 315 bool m_dumpEditingCallbacks; 313 316 bool m_dumpFrameLoadCallbacks; 317 bool m_dumpUserGestureInFrameLoadCallbacks; 314 318 bool m_dumpHistoryDelegateCallbacks; 315 319 bool m_dumpResourceLoadCallbacks; -
trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
r70302 r70470 95 95 bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks); 96 96 bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks); 97 bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks); 97 98 bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks); 98 99 bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes); … … 289 290 } 290 291 292 void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) 293 { 294 m_dumpUserGestureInFrameLoadCallbacks = true; 295 result->setNull(); 296 } 297 291 298 void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) 292 299 { … … 523 530 m_dumpEditingCallbacks = false; 524 531 m_dumpFrameLoadCallbacks = false; 532 m_dumpUserGestureInFrameLoadCallbacks = false; 525 533 m_dumpResourceLoadCallbacks = false; 526 534 m_dumpResourceResponseMIMETypes = false; -
trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
r70064 r70470 89 89 void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*); 90 90 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 91 96 // This function sets a flag that tells the test_shell to print out a text 92 97 // representation of the back/forward list. It ignores all arguments. … … 341 346 bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; } 342 347 void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; } 348 bool shouldDumpUserGestureInFrameLoadCallbacks() { return m_dumpUserGestureInFrameLoadCallbacks; } 349 void setShouldDumpUserGestureInFrameLoadCallbacks(bool value) { m_dumpUserGestureInFrameLoadCallbacks = value; } 343 350 bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; } 344 351 void setShouldDumpResourceResponseMIMETypes(bool value) { m_dumpResourceResponseMIMETypes = value; } … … 461 468 bool m_dumpFrameLoadCallbacks; 462 469 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 463 474 // If true, the test_shell will output a descriptive line for each resource 464 475 // load callback. -
trunk/WebKitTools/DumpRenderTree/chromium/TestShell.h
r68801 r70470 110 110 void setFocus(WebKit::WebWidget*, bool enable); 111 111 bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); } 112 bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpUserGestureInFrameLoadCallbacks(); } 112 113 bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); } 113 114 bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); } -
trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
r70064 r70470 814 814 void WebViewHost::didStartProvisionalLoad(WebFrame* frame) 815 815 { 816 if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks()) 817 printFrameUserGestureStatus(frame, " - in didStartProvisionalLoadForFrame\n"); 816 818 if (m_shell->shouldDumpFrameLoadCallbacks()) { 817 819 printFrameDescription(frame); … … 1306 1308 } 1307 1309 1310 void 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 1308 1316 void WebViewHost::printResourceDescription(unsigned identifier) 1309 1317 { -
trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
r70064 r70470 221 221 void printFrameDescription(WebKit::WebFrame*); 222 222 223 // Dumping the user gesture status to the console. 224 void printFrameUserGestureStatus(WebKit::WebFrame*, const char*); 225 223 226 bool hasWindow() const { return m_hasWindow; } 224 227 void resetScrollRect(); -
trunk/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
r50973 r70470 51 51 #import <WebKit/WebScriptWorld.h> 52 52 #import <WebKit/WebSecurityOriginPrivate.h> 53 #import <WebKit/WebViewPrivate.h> 53 54 #import <wtf/Assertions.h> 54 55 … … 90 91 } 91 92 } 93 94 - (NSString *)_drt_printFrameUserGestureStatus 95 { 96 BOOL isUserGesture = [[self webView] _isProcessingUserGesture]; 97 return [NSString stringWithFormat:@"Frame with user gesture \"%@\"", isUserGesture ? @"true" : @"false"]; 98 } 92 99 @end 93 100 … … 147 154 printf ("%s\n", [string UTF8String]); 148 155 } 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 150 162 ASSERT([frame provisionalDataSource]); 151 163 // Make sure we only set this once per test. If it gets cleared, and then set again, we might … … 167 179 printf ("%s\n", [string UTF8String]); 168 180 } 169 181 170 182 ASSERT(![frame provisionalDataSource]); 171 183 ASSERT([frame dataSource]); … … 191 203 return; 192 204 } 193 205 194 206 ASSERT([frame provisionalDataSource]); 195 207 [self webView:sender locationChangeDone:error forDataSource:[frame provisionalDataSource]]; … … 205 217 printf ("%s\n", [string UTF8String]); 206 218 } 207 219 208 220 // FIXME: This call to displayIfNeeded can be removed when <rdar://problem/5092361> is fixed. 209 221 // After that is fixed, we will reenable painting after WebCore is done loading the document, … … 221 233 printf ("%s\n", [string UTF8String]); 222 234 } 223 235 224 236 ASSERT(![frame provisionalDataSource]); 225 237 ASSERT([frame dataSource]); … … 234 246 printf ("%s\n", [string UTF8String]); 235 247 } 236 248 237 249 ASSERT_NOT_REACHED(); 238 250 } … … 315 327 printf ("%s\n", [string UTF8String]); 316 328 } 317 329 318 330 if (gLayoutTestController->dumpTitleChanges()) 319 331 printf("TITLE CHANGED: %s\n", [title UTF8String]); -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
r70302 r70470 74 74 DumpRenderTreeSupportQt::dumpEditingCallbacks(false); 75 75 DumpRenderTreeSupportQt::dumpFrameLoader(false); 76 DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(false); 76 77 DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false); 77 78 DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(false); … … 245 246 { 246 247 DumpRenderTreeSupportQt::dumpFrameLoader(true); 248 } 249 250 void LayoutTestController::dumpUserGestureInFrameLoadCallbacks() 251 { 252 DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true); 247 253 } 248 254 -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
r70302 r70470 107 107 void dumpEditingCallbacks(); 108 108 void dumpFrameLoadCallbacks(); 109 void dumpUserGestureInFrameLoadCallbacks(); 109 110 void dumpResourceLoadCallbacks(); 110 111 void dumpResourceResponseMIMETypes();
Note: See TracChangeset
for help on using the changeset viewer.