Viewport percentage tests that resize the viewport are flaky
https://bugs.webkit.org/show_bug.cgi?id=133351
Reviewed by Anders Carlsson.
Source/WebCore:
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here.
The resize event will be sent as a side effect of layout instead.
(WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done,
since this is what propagates the new geometry in so the JavaScript code can detect it. Also
simplified the logic and streamlined a little, and added a FIXME about the bad idea here where
the code enqueues an event for an unknown time in the future. Removed the unneeded code that
passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the
target by default.
Tools:
* DumpRenderTree/mac/DumpRenderTree.mm:
(sizeWebViewForCurrentTest): Added a call to reset the window origin, which
happens to be stored in the UI delegate object. This is part of resetting the
window position.
* DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing
a frame rectangle. The size is stored in the size of the web view itself.
* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate resetWindowOrigin]): Added.
(-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The
old version would store the frame, but not resize the web view!
(-[UIDelegate webViewFrame:]): Get the size from the web view.
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::setWindowFrame): Added code to resize the web view.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize
the window.
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the
window gets resized too, not just the web view.
(WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the
window gets resized too, not just the web view.
(WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view.
LayoutTests:
* css3/viewport-percentage-lengths/resources/resize-test.js:
Added code to compensate for the difference between innerWidth/Height and outerWidth/Height
so this works well in a browser window. Added code to "warm up" so the first resize triggers
a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due
to race conditions. One thing I did not fix is the "out of order" problem where all the
test results get written out after the words TEST COMPLETE.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt:
Updated due to changes to the underlying test machinery, and also to show actual expected success.
The old results said PASS with various obviously wrong results.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html:
Changed this test to use the shared resize-test.js.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt:
Updated due to changes to the underlying test machinery, and also to show actual expected success.
The old results said PASS with various obviously wrong results.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html:
Streamlined this test a little.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt:
Updated due to changes to the underlying test machinery, and also to show actual expected success.
The old results said PASS with various obviously wrong results.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html:
Streamlined this test a little.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt:
Updated due to changes to the underlying test machinery, and also to show both expected success,
and some expected failures. These failures were going unnoticed before since the test didn't
successfully do any resizing of the web view.
* css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html:
Streamlined this test a little.
* fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually
resizing. The old test results expected no resizing to occur.
* fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the
test can successfully test asynchronous resizes like the ones done by WebKit2.
* fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so
this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo
as if they were inner coordinates rather than outer. However, the bug this tests for has not
been fixed, so need to expect failures.
* platform/mac/TestExpectations: Added a failure expection for the test above.
* platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result
that successfully resized.
* platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Tools/DumpRenderTree/mac/UIDelegate.h b/Tools/DumpRenderTree/mac/UIDelegate.h
index b5f129a..9b6484e 100644
--- a/Tools/DumpRenderTree/mac/UIDelegate.h
+++ b/Tools/DumpRenderTree/mac/UIDelegate.h
@@ -33,13 +33,13 @@
#endif
@interface UIDelegate : NSObject {
-
@private
- NSRect m_frame;
+ NSPoint windowOrigin;
NSMutableSet *m_pendingGeolocationPermissionListeners;
NSTimer *m_timer;
}
+- (void)resetWindowOrigin;
- (void)didSetMockGeolocationPermission;
- (int)numberOfPendingGeolocationPermissionRequests;