Changeset 63877 in webkit
- Timestamp:
- Jul 21, 2010 11:52:51 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63876 r63877 1 2010-07-21 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 WebKitTestRunner needs layoutTestController.dumpChildFrameScrollPositions 6 https://bugs.webkit.org/show_bug.cgi?id=42548 7 8 * platform/mac-wk2/Skipped: Moved some tests into the correct section 9 now that dumpChildFrameScrollPositions is no longer the reason they 10 fail. Removed now-passing test. Resorted some of the tests. 11 1 12 2010-07-21 Kent Tamura <tkent@chromium.org> 2 13 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r63866 r63877 1662 1662 http/tests/incremental/frame-focus-before-load.html 1663 1663 http/tests/navigation/anchor-basic.html 1664 http/tests/navigation/anchor-frames.html 1664 1665 http/tests/navigation/anchor-goback.html 1666 http/tests/navigation/anchor-subframeload.html 1665 1667 http/tests/navigation/back-to-slow-frame.html 1668 http/tests/navigation/document-location-click-timeout.html 1666 1669 http/tests/navigation/document-location-click.html 1667 http/tests/navigation/document-location-click-timeout.html1668 1670 http/tests/navigation/document-location-mouseover.html 1669 1671 http/tests/navigation/document-location-onload.html … … 1688 1690 http/tests/navigation/multiple-back-forward-entries.html 1689 1691 http/tests/navigation/onload-navigation-iframe-2.html 1692 http/tests/navigation/onload-navigation-iframe-timeout.html 1690 1693 http/tests/navigation/onload-navigation-iframe.html 1691 http/tests/navigation/onload-navigation-iframe-timeout.html1692 1694 http/tests/navigation/parsed-iframe-dynamic-form-back-entry.html 1693 1695 http/tests/navigation/post-basic.html … … 1707 1709 http/tests/navigation/redirect302-subframeload.html 1708 1710 http/tests/navigation/relativeanchor-basic.html 1711 http/tests/navigation/relativeanchor-frames.html 1709 1712 http/tests/navigation/relativeanchor-goback.html 1710 1713 http/tests/navigation/restore-form-state-https.html … … 1712 1715 http/tests/navigation/slowtimerredirect-basic.html 1713 1716 http/tests/navigation/success200-basic.html 1717 http/tests/navigation/success200-frames-loadsame.html 1714 1718 http/tests/navigation/success200-frames.html 1715 http/tests/navigation/success200-frames-loadsame.html1716 1719 http/tests/navigation/success200-goback.html 1717 1720 http/tests/navigation/success200-loadsame.html … … 2238 2241 svg/custom/svg-disallowed-in-dashboard-object.html 2239 2242 2240 # WebKitTestRunner needs layoutTestController.dumpChildFrameScrollPositions2241 # <https://bugs.webkit.org/show_bug.cgi?id=42548>2242 fast/overflow/scrollRevealButton.html2243 http/tests/navigation/anchor-frames.html2244 http/tests/navigation/anchor-subframeload.html2245 http/tests/navigation/relativeanchor-frames.html2246 2247 2243 # WebKitTestRunner needs layoutTestController.markerTextForListItem 2248 2244 # <https://bugs.webkit.org/show_bug.cgi?id=42549> -
trunk/WebKit2/ChangeLog
r63866 r63877 1 2010-07-21 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 WebKitTestRunner needs layoutTestController.dumpChildFrameScrollPositions 6 https://bugs.webkit.org/show_bug.cgi?id=42548 7 8 Added WKBundleFrameCopyName. 9 10 * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: 11 (WKBundleFrameCopyName): Added. 12 * WebProcess/InjectedBundle/API/c/WKBundleFrame.h: Ditto. 13 14 * WebProcess/WebPage/WebFrame.cpp: 15 (WebKit::WebFrame::name): Added. 16 * WebProcess/WebPage/WebFrame.h: Ditto. 17 1 18 2010-07-21 Darin Adler <darin@apple.com> 2 19 -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
r63866 r63877 73 73 return const_cast<JSGlobalContextRef>(toRef(toWK(frameRef)->coreFrame()->script()->globalObject(mainThreadNormalWorld())->globalExec())); 74 74 } 75 76 WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frameRef) 77 { 78 WebCore::String string = toWK(frameRef)->name(); 79 string.impl()->ref(); 80 return toRef(string.impl()); 81 } -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
r63866 r63877 53 53 WK_EXPORT bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frame, WKStringRef name, WKStringRef elementID, double time); 54 54 55 WK_EXPORT WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frame); 56 55 57 #ifdef __cplusplus 56 58 } -
trunk/WebKit2/WebProcess/WebPage/WebFrame.cpp
r63257 r63877 164 164 } 165 165 166 String WebFrame::name() const 167 { 168 if (!m_coreFrame) 169 return String(); 170 171 return m_coreFrame->tree()->name(); 172 } 173 166 174 String WebFrame::url() const 167 175 { -
trunk/WebKit2/WebProcess/WebPage/WebFrame.h
r63257 r63877 66 66 // WKBundleFrame API functions 67 67 bool isMainFrame() const; 68 WebCore::String name() const; 68 69 WebCore::String url() const; 69 70 WebCore::String innerText() const; -
trunk/WebKitTools/ChangeLog
r63866 r63877 1 2010-07-21 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 WebKitTestRunner needs layoutTestController.dumpChildFrameScrollPositions 6 https://bugs.webkit.org/show_bug.cgi?id=42548 7 8 * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: 9 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 10 (WTR::numericWindowPropertyValue): Renamed this and moved it up higher in the file. 11 (WTR::dumpFrameScrollPosition): Added argument telling whether to dump the frame name. 12 Changed to a file-internal function instead of a member function. 13 (WTR::dumpDescendantFrameScrollPositions): Added. 14 (WTR::InjectedBundlePage::dumpAllFrameScrollPositions): Added. 15 (WTR::InjectedBundlePage::dump): Changed to call dumpAllFrameScrollPositions when 16 appropriate. Also streamlined all the WKStringToUTF8 call sites. 17 (WTR::InjectedBundlePage::willAddMessageToConsole): Streamlined use of WKStringToUTF8. 18 (WTR::InjectedBundlePage::willSetStatusbarText): Ditto. 19 (WTR::InjectedBundlePage::willRunJavaScriptAlert): Ditto. 20 (WTR::InjectedBundlePage::willRunJavaScriptConfirm): Ditto. 21 (WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto. 22 23 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Updated for above changes. 24 25 * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: 26 (WTR::LayoutTestController::LayoutTestController): Initialize 27 m_shouldDumpAllFrameScrollPositions. 28 (WTR::LayoutTestController::shouldDumpMainFrameScrollPosition): Renamed from 29 shouldDumpFrameScrollPositions. 30 31 * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Reorganized the file a 32 bit, added dumpChildFrameScrollPositions and shouldDumpAllFrameScrollPositions, 33 and renamed shouldDumpFrameScrollPositions to shouldDumpMainFrameScrollPosition. 34 1 35 2010-07-21 Darin Adler <darin@apple.com> 2 36 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
r63693 r63877 27 27 28 28 interface LayoutTestController { 29 // The basics. 29 30 void dumpAsText(); 30 void dumpStatusCallbacks();31 32 31 void waitUntilDone(); 33 32 void notifyDone(); 34 33 35 // Repaint testing 34 // Other kinds of dumping. 35 void dumpChildFrameScrollPositions(); 36 void dumpStatusCallbacks(); 37 38 // Repaint testing. 36 39 void testRepaint(); 37 40 void repaintSweepHorizontally(); 38 41 void display(); 39 42 40 // Animation testing 43 // Animation testing. 41 44 int numberOfActiveAnimations(); 42 45 boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId); -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r63866 r63877 27 27 28 28 #include "InjectedBundle.h" 29 #include <JavaScriptCore/JSRetainPtr.h> 30 #include <WebKit2/WKArray.h> 29 31 #include <WebKit2/WKBundleFrame.h> 30 32 #include <WebKit2/WKBundlePagePrivate.h> … … 145 147 } 146 148 149 static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName) 150 { 151 JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame); 152 JSObjectRef window = JSContextGetGlobalObject(context); 153 JSValueRef exception = 0; 154 JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName)); 155 JSValueRef value = JSObjectGetProperty(context, window, propertyNameString.get(), &exception); 156 if (exception) 157 return 0; 158 return JSValueToNumber(context, value, &exception); 159 } 160 161 enum FrameNamePolicy { ShouldNotIncludeFrameName, ShouldIncludeFrameName }; 162 163 static void dumpFrameScrollPosition(WKBundleFrameRef frame, FrameNamePolicy shouldIncludeFrameName = ShouldNotIncludeFrameName) 164 { 165 double x = numericWindowPropertyValue(frame, "pageXOffset"); 166 double y = numericWindowPropertyValue(frame, "pageYOffset"); 167 if (fabs(x) > 0.00000001 || fabs(y) > 0.00000001) { 168 if (shouldIncludeFrameName) { 169 WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame)); 170 InjectedBundle::shared().os() << "frame '" << WKStringToUTF8(name.get())->data() << "' "; 171 } 172 InjectedBundle::shared().os() << "scrolled to " << x << "," << y << "\n"; 173 } 174 } 175 176 static void dumpDescendantFrameScrollPositions(WKBundleFrameRef frame) 177 { 178 WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame)); 179 size_t size = WKArrayGetSize(childFrames.get()); 180 for (size_t i = 0; i < size; ++i) { 181 // FIXME: I don't like that we have to const_cast here. Can we change WKArray? 182 WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(const_cast<void*>(WKArrayGetItemAtIndex(childFrames.get(), i))); 183 dumpFrameScrollPosition(subframe, ShouldIncludeFrameName); 184 dumpDescendantFrameScrollPositions(subframe); 185 } 186 } 187 188 void InjectedBundlePage::dumpAllFrameScrollPositions() 189 { 190 WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page); 191 dumpFrameScrollPosition(frame); 192 dumpDescendantFrameScrollPositions(frame); 193 } 194 147 195 void InjectedBundlePage::dump() 148 196 { … … 152 200 // FIXME: Support dumping subframes when layoutTestController()->dumpChildFramesAsText() is true. 153 201 WKRetainPtr<WKStringRef> innerText(AdoptWK, WKBundleFrameCopyInnerText(WKBundlePageGetMainFrame(m_page))); 154 OwnPtr<Vector<char> > utf8InnerText = WKStringToUTF8(innerText.get()); 155 InjectedBundle::shared().os() << utf8InnerText->data() << "\n"; 202 InjectedBundle::shared().os() << WKStringToUTF8(innerText.get())->data() << "\n"; 156 203 } else { 157 204 WKRetainPtr<WKStringRef> externalRepresentation(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page)); 158 OwnPtr<Vector<char> > utf8externalRepresentation = WKStringToUTF8(externalRepresentation.get()); 159 InjectedBundle::shared().os() << utf8externalRepresentation->data(); 205 InjectedBundle::shared().os() << WKStringToUTF8(externalRepresentation.get())->data(); 160 206 } 161 207 162 if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameScrollPositions()) 208 if (InjectedBundle::shared().layoutTestController()->shouldDumpAllFrameScrollPositions()) 209 dumpAllFrameScrollPositions(); 210 else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition()) 163 211 dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page)); 164 212 165 213 InjectedBundle::shared().done(); 166 }167 168 static double numericWindowProperty(WKBundleFrameRef frame, const char* propertyName)169 {170 JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);171 JSObjectRef window = JSContextGetGlobalObject(context);172 JSValueRef exception = 0;173 JSStringRef propertyNameString = JSStringCreateWithUTF8CString(propertyName);174 JSValueRef value = JSObjectGetProperty(context, window, propertyNameString, &exception);175 JSStringRelease(propertyNameString);176 if (exception)177 return 0;178 return JSValueToNumber(context, value, &exception);179 }180 181 void InjectedBundlePage::dumpFrameScrollPosition(WKBundleFrameRef frame)182 {183 double x = numericWindowProperty(frame, "pageXOffset");184 double y = numericWindowProperty(frame, "pageYOffset");185 if (fabs(x) > 0.00000001 || fabs(y) > 0.00000001)186 InjectedBundle::shared().os() << "scrolled to " << x << "," << y << "\n";187 214 } 188 215 … … 250 277 { 251 278 // FIXME: Strip file: urls. 252 OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message); 253 InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << utf8Message->data() << "\n"; 279 InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << WKStringToUTF8(message)->data() << "\n"; 254 280 } 255 281 … … 259 285 return; 260 286 261 OwnPtr<Vector<char> > utf8StatusbarText = WKStringToUTF8(statusbarText); 262 InjectedBundle::shared().os() << "UI DELEGATE STATUS CALLBACK: setStatusText:" << utf8StatusbarText->data() << "\n"; 287 InjectedBundle::shared().os() << "UI DELEGATE STATUS CALLBACK: setStatusText:" << WKStringToUTF8(statusbarText)->data() << "\n"; 263 288 } 264 289 265 290 void InjectedBundlePage::willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef) 266 291 { 267 OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message); 268 InjectedBundle::shared().os() << "ALERT: " << utf8Message->data() << "\n"; 292 InjectedBundle::shared().os() << "ALERT: " << WKStringToUTF8(message)->data() << "\n"; 269 293 } 270 294 271 295 void InjectedBundlePage::willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef) 272 296 { 273 OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message); 274 InjectedBundle::shared().os() << "CONFIRM: " << utf8Message->data() << "\n"; 297 InjectedBundle::shared().os() << "CONFIRM: " << WKStringToUTF8(message)->data() << "\n"; 275 298 } 276 299 277 300 void InjectedBundlePage::willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef) 278 301 { 279 OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message); 280 OwnPtr<Vector<char> > utf8DefaultValue = WKStringToUTF8(defaultValue); 281 InjectedBundle::shared().os() << "PROMPT: " << utf8Message->data() << ", default text: " << utf8DefaultValue->data() << "\n"; 302 InjectedBundle::shared().os() << "PROMPT: " << WKStringToUTF8(message)->data() << ", default text: " << WKStringToUTF8(defaultValue)->data() << "\n"; 282 303 } 283 304 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
r63866 r63877 72 72 void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef); 73 73 74 void dump FrameScrollPosition(WKBundleFrameRef);74 void dumpAllFrameScrollPositions(); 75 75 76 76 WKBundlePageRef m_page; -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
r63866 r63877 44 44 LayoutTestController::LayoutTestController(const std::string& testPathOrURL) 45 45 : m_dumpAsText(false) 46 , m_shouldDumpAllFrameScrollPositions(false) 46 47 , m_dumpStatusCallbacks(false) 47 48 , m_waitToDump(false) … … 135 136 } 136 137 137 bool LayoutTestController::shouldDump FrameScrollPositions() const138 bool LayoutTestController::shouldDumpMainFrameScrollPosition() const 138 139 { 139 140 return !shouldDumpAsText() && !shouldDumpDOMAsWebArchive() && !shouldDumpSourceAsWebArchive(); -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
r63866 r63877 38 38 public: 39 39 static PassRefPtr<LayoutTestController> create(const std::string& testPathOrURL); 40 ~LayoutTestController();40 virtual ~LayoutTestController(); 41 41 42 42 // JSWrappable 43 JSClassRef wrapperClass();43 virtual JSClassRef wrapperClass(); 44 44 45 void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception);45 void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception); 46 46 47 // The basics. 47 48 void dumpAsText() { m_dumpAsText = true; } 49 void waitUntilDone(); 50 void notifyDone(); 51 52 // Other kinds of dumping. 53 void dumpChildFrameScrollPositions() { m_shouldDumpAllFrameScrollPositions = true; } 48 54 void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; } 49 55 56 // Repaint testing. 57 void testRepaint() { m_testRepaint = true; } 58 void repaintSweepHorizontally() { m_testRepaintSweepHorizontally = true; } 59 void display(); 60 61 // Animation testing. 62 unsigned numberOfActiveAnimations() const; 63 bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId); 64 65 bool shouldDumpAllFrameScrollPositions() const { return m_shouldDumpAllFrameScrollPositions; } 50 66 bool shouldDumpAsText() const { return m_dumpAsText; } 51 67 bool shouldDumpDOMAsWebArchive() const; 52 bool shouldDump FrameScrollPositions() const;68 bool shouldDumpMainFrameScrollPosition() const; 53 69 bool shouldDumpSourceAsWebArchive() const; 54 70 bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; } … … 57 73 void waitToDumpWatchdogTimerFired(); 58 74 void invalidateWaitToDumpWatchdog(); 59 void waitUntilDone();60 void notifyDone();61 62 void testRepaint() { m_testRepaint = true; }63 void repaintSweepHorizontally() { m_testRepaintSweepHorizontally = true; }64 void display();65 66 unsigned numberOfActiveAnimations() const;67 bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId);68 75 69 76 private: … … 71 78 72 79 bool m_dumpAsText; 80 bool m_shouldDumpAllFrameScrollPositions; 73 81 bool m_dumpStatusCallbacks; 74 82 bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
Note: See TracChangeset
for help on using the changeset viewer.