Changeset 136940 in webkit
- Timestamp:
- Dec 7, 2012, 2:22:06 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h
r127757 r136940 56 56 virtual void didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGlobalContextRef, JSObjectRef windowObject) = 0; 57 57 virtual void didReceiveTitleForFrame(const String& title, WebCore::Frame*) = 0; 58 virtual void didDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&) = 0; 58 virtual void didDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WebCore::Frame*) = 0; 59 virtual void didDecidePolicyForResponse(const WebCore::ResourceResponse&) = 0; 59 60 virtual void didDispatchWillPerformClientRedirect() = 0; 60 61 virtual void didHandleOnloadEventsForFrame(WebCore::Frame*) = 0; 61 62 62 63 // ChromeClient delegates 63 virtual void addMessageToConsole(const String& message, unsigned intlineNumber, const String& sourceID) = 0;64 virtual void addMessageToConsole(const String& message, unsigned lineNumber, const String& sourceID) = 0; 64 65 virtual void runJavaScriptAlert(const String& message) = 0; 65 66 virtual bool runJavaScriptConfirm(const String& message) = 0; -
trunk/Source/WebKit/blackberry/ChangeLog
r136930 r136940 1 2012-12-07 Xiaobo Wang <xbwang@torchmobile.com.cn> 2 3 [BlackBerry] DRT - Update implementation of TestRunner.setCustomPolicyDelegate() 4 https://bugs.webkit.org/show_bug.cgi?id=104243 5 6 RIM PR 259337 7 8 Reviewed by Rob Buis. 9 10 1. Add DRT callback in dispatchDecidePolicyForResponse. 11 2. Pass frame pointer to DRT callback in 12 dispatchDecidePolicyForNavigationAction, so that it can be used to 13 calculate originating. 14 3. Fix some webkit style errors. 15 16 The patch fixed the following tests: 17 - http/tests/download 18 - fast/forms/mailto/formenctype-attribute-button-html.html 19 - fast/forms/mailto/formenctype-attribute-input-html.html 20 - fast/encoding/mailto-always-utf-8.html 21 22 * Api/DumpRenderTreeClient.h: 23 * WebCoreSupport/FrameLoaderClientBlackBerry.cpp: 24 (WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForResponse): 25 (WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction): 26 (WebCore::FrameLoaderClientBlackBerry::transitionToCommittedForNewPage): 27 (WebCore::FrameLoaderClientBlackBerry::dispatchDidFinishLoad): 28 (WebCore::FrameLoaderClientBlackBerry::dispatchDidFailProvisionalLoad): 29 (WebCore::FrameLoaderClientBlackBerry::dispatchWillSendRequest): 30 (WebCore::FrameLoaderClientBlackBerry::decidePolicyForExternalLoad): 31 1 32 2012-12-07 Mary Wu <mary.wu@torchmobile.com.cn> 2 33 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
r136930 r136940 201 201 policy = PolicyDownload; 202 202 203 if (m_webPagePrivate->m_dumpRenderTree) 204 m_webPagePrivate->m_dumpRenderTree->didDecidePolicyForResponse(response); 205 203 206 (m_frame->loader()->policyChecker()->*function)(policy); 204 207 } … … 244 247 dispatchDidCancelClientRedirect(); 245 248 249 if (m_webPagePrivate->m_dumpRenderTree) 250 m_webPagePrivate->m_dumpRenderTree->didDecidePolicyForNavigationAction(action, request, m_frame); 251 246 252 (m_frame->loader()->policyChecker()->*function)(decision); 247 248 if (m_webPagePrivate->m_dumpRenderTree)249 m_webPagePrivate->m_dumpRenderTree->didDecidePolicyForNavigationAction(action, request);250 253 } 251 254 … … 448 451 449 452 m_frame->createView(m_webPagePrivate->viewportSize(), /* viewport */ 450 451 452 453 454 455 456 457 458 459 453 backgroundColor, /* background color */ 454 backgroundColor.hasAlpha(), /* is transparent */ 455 m_webPagePrivate->actualVisibleSize(), /* fixed reported size */ 456 m_webPagePrivate->fixedLayoutSize(), /* fixed layout size */ 457 IntRect(), /* fixed visible content rect */ 458 m_webPagePrivate->useFixedLayout(), /* use fixed layout */ 459 ScrollbarAlwaysOff, /* hor mode */ 460 true, /* lock the mode */ 461 ScrollbarAlwaysOff, /* ver mode */ 462 true); /* lock the mode */ 460 463 461 464 if (isMainFrame() && m_webPagePrivate->backingStoreClient()) { … … 602 605 // Process document metadata. 603 606 RefPtr<NodeList> nodeList = headElement->getElementsByTagName(HTMLNames::metaTag.localName()); 604 unsigned intsize = nodeList->length();607 unsigned size = nodeList->length(); 605 608 ScopeArray<BlackBerry::Platform::String> headers; 606 609 … … 698 701 699 702 if (error.domain() == ResourceError::platformErrorDomain 700 703 && (error.errorCode() == BlackBerry::Platform::FilterStream::StatusErrorAlreadyHandled)) { 701 704 // Error has already been displayed by client. 702 705 return; … … 980 983 } 981 984 982 void FrameLoaderClientBlackBerry::dispatchWillSendRequest(DocumentLoader* docLoader, long unsigned int, ResourceRequest& request, const ResourceResponse&)985 void FrameLoaderClientBlackBerry::dispatchWillSendRequest(DocumentLoader* docLoader, long unsigned, ResourceRequest& request, const ResourceResponse&) 983 986 { 984 987 // If the request is being loaded by the provisional document loader, then … … 1154 1157 1155 1158 if (m_webPagePrivate->m_webSettings->areLinksHandledExternally() 1156 1157 1158 1159 && isMainFrame() 1160 && !request.mustHandleInternally() 1161 && !isFragmentScroll) { 1159 1162 NetworkRequest platformRequest; 1160 1163 request.initializePlatformRequest(platformRequest, cookiesEnabled()); -
trunk/Tools/ChangeLog
r136934 r136940 1 2012-12-07 Xiaobo Wang <xbwang@torchmobile.com.cn> 2 3 [BlackBerry] DRT - Update implementation of TestRunner.setCustomPolicyDelegate() 4 https://bugs.webkit.org/show_bug.cgi?id=104243 5 6 RIM PR 259337 7 8 Reviewed by Rob Buis. 9 10 1. Implement calculation of navigation originating in 11 didDecidePolicyForNavigationAction(). 12 2. Implement policy delegate for resource response. 13 3. Enable customPolicyDelegate if waitForPolicyDelegate() is called. 14 4. Minor optional updates in dump() and dumpFrameLoadCallbacks(). 15 16 The patch fixed the following tests: 17 - http/tests/download 18 - fast/forms/mailto/formenctype-attribute-button-html.html 19 - fast/forms/mailto/formenctype-attribute-input-html.html 20 - fast/encoding/mailto-always-utf-8.html 21 22 * DumpRenderTree/blackberry/DumpRenderTree.cpp: 23 (BlackBerry::WebKit::DumpRenderTree::DumpRenderTree): 24 (BlackBerry::WebKit::DumpRenderTree::resetToConsistentStateBeforeTesting): 25 (BlackBerry::WebKit::DumpRenderTree::dump): 26 (BlackBerry::WebKit::DumpRenderTree::didFinishLoadForFrame): 27 (BlackBerry::WebKit::DumpRenderTree::didDecidePolicyForNavigationAction): 28 (BlackBerry::WebKit::DumpRenderTree::didDecidePolicyForResponse): 29 (BlackBerry::WebKit::DumpRenderTree::setCustomPolicyDelegate): 30 * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h: 31 (DumpRenderTree): 32 * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: 33 (TestRunner::setCustomPolicyDelegate): 34 (TestRunner::waitForPolicyDelegate): 35 (TestRunner::overridePreference): 36 1 37 2012-12-07 Gwang Yoon Hwang <ryumiel@company100.net> 2 38 -
trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
r136628 r136940 38 38 #include "FrameTree.h" 39 39 #include "FrameView.h" 40 #include "HTTPParsers.h" 40 41 #include "HistoryItem.h" 42 #include "HitTestResult.h" 41 43 #include "IntSize.h" 42 44 #include "JSDOMBinding.h" 45 #include "MouseEvent.h" 46 #include "Node.h" 43 47 #include "NotImplemented.h" 44 48 #include "Page.h" … … 164 168 , m_workTimer(this, &DumpRenderTree::processWork) 165 169 , m_acceptsEditing(true) 170 , m_policyDelegateEnabled(false) 166 171 { 167 172 const char* workerNumber = getenv("WORKER_NUMBER") ? getenv("WORKER_NUMBER") : "0"; … … 272 277 m_loadFinished = false; 273 278 s_selectTrailingWhitespaceEnabled = false; 274 279 m_policyDelegateEnabled = false; 280 waitForPolicy = false; 275 281 testDone = false; 276 282 WorkQueue::shared()->clear(); … … 524 530 525 531 if (!runFromCommandLine) { 526 // signal end of text block527 fputs("#EOF\n", stdout);528 529 532 // There are two scenarios for dumping pixels: 530 533 // 1. When the test case explicitly asks for it by calling dumpAsText(true) with that extra true passed as a parameter value, from JavaScript … … 535 538 // But only if m_enablePixelTests is set, to say that the user wants to run pixel tests at all. 536 539 bool generatePixelResults = m_enablePixelTests && (explicitPixelResults || implicitPixelResults); 537 if (generatePixelResults) 540 if (generatePixelResults) { 541 // signal end of text block 542 fputs("#EOF\n", stdout); 538 543 dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); 544 } 539 545 540 546 String crashFile = dumpFile + ".crash"; … … 631 637 printf("%s - didFinishLoadForFrame\n", drtFrameDescription(frame).utf8().data()); 632 638 633 if (frame == topLoadingFrame) 639 if (frame == topLoadingFrame) { 634 640 m_loadFinished = true; 635 locationChangeForFrame(frame); 641 locationChangeForFrame(frame); 642 } 636 643 } 637 644 … … 832 839 } 833 840 834 void DumpRenderTree::didDecidePolicyForNavigationAction(const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request )835 { 836 if ( !waitForPolicy)841 void DumpRenderTree::didDecidePolicyForNavigationAction(const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, WebCore::Frame* frame) 842 { 843 if (testDone || !m_policyDelegateEnabled) 837 844 return; 838 845 … … 861 868 } 862 869 863 printf("Policy delegate: attempt to load %s with navigation type '%s'\n", request.url().string().utf8().data(), typeDescription); 864 // FIXME: do originating part. 865 866 gTestRunner->notifyDone(); 870 bool shouldWaitForResponse = !request.url().string().startsWith("mailto:"); 871 printf("Policy delegate: attempt to load %s with navigation type '%s'", request.url().string().utf8().data(), typeDescription); 872 // Originating part, borrowed from Chromium. 873 RefPtr<WebCore::Node> node; 874 for (const WebCore::Event* event = action.event(); event; event = event->underlyingEvent()) { 875 if (event->isMouseEvent()) { 876 const WebCore::MouseEvent* mouseEvent = static_cast<const WebCore::MouseEvent*>(event); 877 node = frame->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false).innerNonSharedNode(); 878 break; 879 } 880 } 881 if (node.get()) 882 printf(" originating from %s\n", drtDumpPath(node.get()).utf8().data()); 883 else 884 printf("\n"); 885 886 if (waitForPolicy && !shouldWaitForResponse) 887 gTestRunner->notifyDone(); 888 } 889 890 void DumpRenderTree::didDecidePolicyForResponse(const WebCore::ResourceResponse& response) 891 { 892 if (!testDone && m_policyDelegateEnabled) { 893 if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment) 894 printf("Policy delegate: resource is an attachment, suggested file name '%s'\n", response.suggestedFilename().utf8().data()); 895 if (waitForPolicy) 896 gTestRunner->notifyDone(); 897 } 867 898 } 868 899 … … 899 930 } 900 931 932 void DumpRenderTree::setCustomPolicyDelegate(bool setDelegate, bool permissive) 933 { 934 m_policyDelegateEnabled = setDelegate; 935 UNUSED_PARAM(permissive); 936 } 901 937 } 902 938 } -
trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h
r133166 r136940 72 72 void didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGlobalContextRef, JSObjectRef windowObject); 73 73 void didReceiveTitleForFrame(const String& title, WebCore::Frame*); 74 void didDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&); 74 void didDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WebCore::Frame*); 75 void didDecidePolicyForResponse(const WebCore::ResourceResponse&); 75 76 void didDispatchWillPerformClientRedirect(); 76 77 void didHandleOnloadEventsForFrame(WebCore::Frame*); … … 108 109 // BlackBerry::Platform::BlackBerryPlatformLayoutTestClient method 109 110 virtual void addTest(const char* testFile); 111 void setCustomPolicyDelegate(bool setDelegate, bool permissive); 110 112 private: 111 113 void runTest(const String& url, const String& imageHash); … … 148 150 bool m_loadFinished; 149 151 static bool s_selectTrailingWhitespaceEnabled; 152 bool m_policyDelegateEnabled; 150 153 }; 151 154 } -
trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
r136323 r136940 192 192 void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) 193 193 { 194 UNUSED_PARAM(setDelegate); 195 UNUSED_PARAM(permissive); 196 notImplemented(); 194 BlackBerry::WebKit::DumpRenderTree::currentInstance()->setCustomPolicyDelegate(setDelegate, permissive); 197 195 } 198 196 … … 303 301 void TestRunner::waitForPolicyDelegate() 304 302 { 303 setCustomPolicyDelegate(true, true); 305 304 setWaitToDump(true); 306 305 waitForPolicy = true; … … 440 439 else if (keyStr == "WebSocketsEnabled") 441 440 BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setWebSocketsEnabled(valueStr == "true" || valueStr == "1"); 441 else if (keyStr == "WebKitDefaultTextEncodingName") 442 BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setDefaultTextEncodingName(valueStr); 442 443 } 443 444
Note:
See TracChangeset
for help on using the changeset viewer.