Diff
Modified: trunk/LayoutTests/ChangeLog (104397 => 104398)
--- trunk/LayoutTests/ChangeLog 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/LayoutTests/ChangeLog 2012-01-08 08:06:38 UTC (rev 104398)
@@ -1,3 +1,20 @@
+2012-01-08 David Levin <le...@chromium.org>
+
+ [chromium] Add layout test support for autosize code in FrameView.
+ https://bugs.webkit.org/show_bug.cgi?id=73631
+
+ Reviewed by Dmitry Titov.
+
+ * fast/autoresize/basic-expected.txt: Added.
+ * fast/autoresize/basic.html: Added. Simple test to verify that autoresizing happens.
+ * platform/efl/Skipped: Skipped the new directory since the layout test
+ controller on this platform, doesn't support enableAutoResizeMode.
+ * platform/gtk/Skipped: Ditto.
+ * platform/mac/Skipped: Ditto.
+ * platform/qt/Skipped: Ditto.
+ * platform/win/Skipped: Ditto.
+ * platform/wincairo/Skipped: Ditto.
+
2012-01-07 Dmitry Lomov <dslo...@google.com>
Unreviewed; chromium tests rebaselined after r104240.
Added: trunk/LayoutTests/fast/autoresize/basic-expected.txt (0 => 104398)
--- trunk/LayoutTests/fast/autoresize/basic-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/autoresize/basic-expected.txt 2012-01-08 08:06:38 UTC (rev 104398)
@@ -0,0 +1,12 @@
+This test only works in when run in dumprendertree as it relies on having auto-resize enabled its window.
+
+When it succeeds, there should be a series of PASS messages followed by a DONE message.
+
+PASS: document.body.clientWidth equaled window.innerWidth
+PASS: document.body.clientHeight equaled window.innerHeight
+PASS: document.body.scrollWidth equaled window.innerWidth
+PASS: document.body.scrollHeight equaled window.innerHeight
+PASS: window.innerWidth equaled window.outerWidth
+PASS: window.innerHeight equaled window.outerHeight
+DONE
+
Added: trunk/LayoutTests/fast/autoresize/basic.html (0 => 104398)
--- trunk/LayoutTests/fast/autoresize/basic.html (rev 0)
+++ trunk/LayoutTests/fast/autoresize/basic.html 2012-01-08 08:06:38 UTC (rev 104398)
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function shouldBe(a, b)
+{
+ aValue = eval(a);
+ bValue = eval(b);
+ if (aValue == bValue)
+ log('PASS: ' + a + ' equaled ' + b);
+ else
+ log('FAILED: ' + a + '(' + aValue + ') did not equal ' + b + '(' + bValue + ')');
+}
+
+function runTest()
+{
+ if (window.layoutTestController) {
+ layoutTestController.enableAutoResizeMode(10, 10, 1000, 1000);
+ layoutTestController.dumpAsText();
+ }
+ shouldBe('document.body.clientWidth', 'window.innerWidth');
+ shouldBe('document.body.clientHeight', 'window.innerHeight');
+ shouldBe('document.body.scrollWidth', 'window.innerWidth');
+ shouldBe('document.body.scrollHeight', 'window.innerHeight');
+ shouldBe('window.innerWidth', 'window.outerWidth');
+ shouldBe('window.innerHeight', 'window.outerHeight');
+ log('DONE');
+}
+</script>
+<body _onload_="runTest()" style="margin:0; width:900px">
+This test only works in when run in dumprendertree as it relies on having auto-resize enabled its window.
+<br>
+<br>
+When it succeeds, there should be a series of PASS messages followed by a DONE message.
+<br>
+<br>
+<div id='result'>
+</div>
+</body>
+</html>
Modified: trunk/LayoutTests/platform/efl/Skipped (104397 => 104398)
--- trunk/LayoutTests/platform/efl/Skipped 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/LayoutTests/platform/efl/Skipped 2012-01-08 08:06:38 UTC (rev 104398)
@@ -477,6 +477,9 @@
fast/media/media-query-list-07.html
fast/media/view-mode-media-feature.html
+# EFL's LayoutTestController does not implement enableAutoResizeMode
+fast/autoresize
+
# EFL's LayoutTestController does not implement setWindowIsKey
editing/selection/4975120.html
editing/selection/caret-and-focus-ring.html
Modified: trunk/LayoutTests/platform/gtk/Skipped (104397 => 104398)
--- trunk/LayoutTests/platform/gtk/Skipped 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/LayoutTests/platform/gtk/Skipped 2012-01-08 08:06:38 UTC (rev 104398)
@@ -373,6 +373,9 @@
# supported.
fast/text/international/locale-sensitive-fonts.html
+# Needs layoutTestController.enableAutoResizeMode()
+fast/autoresize
+
# The GTK+ build bots don't yet have the muscle to run WebGL tests.
compositing/webgl
fast/canvas/webgl
Modified: trunk/LayoutTests/platform/mac/Skipped (104397 => 104398)
--- trunk/LayoutTests/platform/mac/Skipped 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/LayoutTests/platform/mac/Skipped 2012-01-08 08:06:38 UTC (rev 104398)
@@ -132,6 +132,9 @@
fast/media/media-query-list-06.html
fast/media/media-query-list-07.html
+# Needs layoutTestController.enableAutoResizeMode()
+fast/autoresize
+
# Test is flaky and thus not useful until fixed.
# https://bugs.webkit.org/show_bug.cgi?id=36642
fast/replaced/border-radius-clip.html
Modified: trunk/LayoutTests/platform/qt/Skipped (104397 => 104398)
--- trunk/LayoutTests/platform/qt/Skipped 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/LayoutTests/platform/qt/Skipped 2012-01-08 08:06:38 UTC (rev 104398)
@@ -694,6 +694,9 @@
fast/repaint/text-emphasis-v.html
fast/repaint/background-clip-text.html
+# Needs layoutTestController.enableAutoResizeMode()
+fast/autoresize
+
# This requires didClearWindowObjectForFrameInIsolatedWorld foo in FrameLoaderClient
http/tests/security/isolatedWorld/didClearWindowObject.html
# This needs more investigation
Modified: trunk/LayoutTests/platform/win/Skipped (104397 => 104398)
--- trunk/LayoutTests/platform/win/Skipped 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/LayoutTests/platform/win/Skipped 2012-01-08 08:06:38 UTC (rev 104398)
@@ -1074,6 +1074,9 @@
# LayoutTestController::pageProperty is not implemented for WIN yet.
printing/page-rule-selection.html
+# Needs layoutTestController.enableAutoResizeMode()
+fast/autoresize
+
# Hyphenation is not implemented yet.
fast/text/hyphenate-character.html
fast/text/hyphens.html
Modified: trunk/LayoutTests/platform/wincairo/Skipped (104397 => 104398)
--- trunk/LayoutTests/platform/wincairo/Skipped 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/LayoutTests/platform/wincairo/Skipped 2012-01-08 08:06:38 UTC (rev 104398)
@@ -1612,6 +1612,9 @@
# LayoutTestController::pageProperty is not implemented for WIN yet.
printing/page-rule-selection.html
+# Needs layoutTestController.enableAutoResizeMode()
+fast/autoresize
+
# Hyphenation is not implemented yet.
fast/text/hyphenate-character.html
fast/text/hyphens.html
Modified: trunk/Tools/ChangeLog (104397 => 104398)
--- trunk/Tools/ChangeLog 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/Tools/ChangeLog 2012-01-08 08:06:38 UTC (rev 104398)
@@ -1,3 +1,19 @@
+2012-01-08 David Levin <le...@chromium.org>
+
+ [chromium] Add layout test support for autosize code in FrameView.
+ https://bugs.webkit.org/show_bug.cgi?id=73631
+
+ Reviewed by Dmitry Titov.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController): Expose the new autoresize method.
+ (LayoutTestController::reset): Set the autoresize mode back to false.
+ (LayoutTestController::enableAutoResizeMode): A way to turn on autoresizing from _javascript_ code in DumpRenderTree.
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didAutoResize): Handle the autoresize callback so that the outer bounds change appropriately.
+ * DumpRenderTree/chromium/WebViewHost.h:
+
2012-01-07 Zan Dobersek <zandober...@gmail.com>
[WK2][GTK] Each test takes roughly half a second to load
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (104397 => 104398)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2012-01-08 08:06:38 UTC (rev 104398)
@@ -116,6 +116,7 @@
bindMethod("dumpPermissionClientCallbacks", &LayoutTestController::dumpPermissionClientCallbacks);
bindMethod("dumpCreateView", &LayoutTestController::dumpCreateView);
bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
+ bindMethod("enableAutoResizeMode", &LayoutTestController::enableAutoResizeMode);
bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
bindMethod("setIsolatedWorldSecurityOrigin", &LayoutTestController::setIsolatedWorldSecurityOrigin);
@@ -608,6 +609,8 @@
m_shell->webView()->setSelectionColors(0xff1e90ff, 0xff000000, 0xffc8c8c8, 0xff323232);
#endif
m_shell->webView()->removeAllUserContent();
+ WebKit::WebSize empty;
+ m_shell->webView()->enableAutoResizeMode(false, empty, empty);
}
m_dumpAsText = false;
m_dumpAsAudio = false;
@@ -1098,6 +1101,24 @@
result->set(elementDoesAutoCompleteForElementWithId(elementId));
}
+void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 4) {
+ result->set(false);
+ return;
+ }
+ int minWidth = cppVariantToInt32(arguments[0]);
+ int minHeight = cppVariantToInt32(arguments[1]);
+ WebKit::WebSize minSize(minWidth, minHeight);
+
+ int maxWidth = cppVariantToInt32(arguments[2]);
+ int maxHeight = cppVariantToInt32(arguments[3]);
+ WebKit::WebSize maxSize(maxWidth, maxHeight);
+
+ m_shell->webView()->enableAutoResizeMode(true, minSize, maxSize);
+ result->set(true);
+}
+
void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result)
{
result->set(numberOfActiveAnimations());
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h (104397 => 104398)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h 2012-01-08 08:06:38 UTC (rev 104398)
@@ -243,6 +243,7 @@
void pauseAnimationAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
void pauseTransitionAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
void elementDoesAutoCompleteForElementWithId(const CppArgumentList&, CppVariant*);
+ void enableAutoResizeMode(const CppArgumentList&, CppVariant*);
void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
void suspendAnimations(const CppArgumentList&, CppVariant*);
void resumeAnimations(const CppArgumentList&, CppVariant*);
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (104397 => 104398)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-01-08 08:06:38 UTC (rev 104398)
@@ -709,6 +709,13 @@
didInvalidateRect(clipRect);
}
+void WebViewHost::didAutoResize(const WebSize& newSize)
+{
+ // Purposely don't include the virtualWindowBorder in this case so that
+ // window.inner[Width|Height] is the same as window.outer[Width|Height]
+ setWindowRect(WebRect(0, 0, newSize.width, newSize.height));
+}
+
void WebViewHost::scheduleComposite()
{
WebSize widgetSize = webWidget()->size();
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (104397 => 104398)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2012-01-08 03:59:43 UTC (rev 104397)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2012-01-08 08:06:38 UTC (rev 104398)
@@ -154,6 +154,7 @@
// WebKit::WebWidgetClient
virtual void didInvalidateRect(const WebKit::WebRect&);
virtual void didScrollRect(int dx, int dy, const WebKit::WebRect&);
+ virtual void didAutoResize(const WebKit::WebSize& newSize);
virtual void scheduleComposite();
#if ENABLE(REQUEST_ANIMATION_FRAME)
virtual void scheduleAnimation();