Commit 5cf7fa8a authored by rniwa@webkit.org's avatar rniwa@webkit.org

Use testRunner instead of layoutTestController in networkinformation, perf,...

Use testRunner instead of layoutTestController in networkinformation, perf, plugins, pointer-lock, printing, scrollbars, and security tests
https://bugs.webkit.org/show_bug.cgi?id=89181

Reviewed by Kent Tamura.

* perf/clone-with-focus.html:
* perf/nested-combined-selectors.html:
* perf/table-rows-length-caching.html:
* platform/chromium/plugins/call-as-function.html:
* platform/chromium/plugins/get-url-with-blank-target2.html:
* platform/chromium/plugins/get-url-with-iframe-target-no-crash.html:
* platform/chromium/printing/custom-page-size-style-expected.txt:
* platform/chromium/printing/custom-page-size-style.html:
* platform/gtk/plugins/invalidate-rect-with-null-npp-argument.html:
* platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html:
* platform/mac-wk2/plugins/contents-scale-factor.html:
* platform/mac-wk2/plugins/mouse-events-scaled.html:
* platform/mac/plugins/bindings-array-apply-crash.html:
* platform/mac/plugins/bindings-objc-long-method-name.html:
* platform/mac/plugins/bindings-objc-method-name-conversion.html:
* platform/mac/plugins/bindings-test-objc.html:
* platform/mac/plugins/call-as-function-test.html:
* platform/mac/plugins/convert-point.html:
* platform/mac/plugins/disable-plugins.html:
* platform/mac/plugins/jsobjc-dom-wrappers.html:
* platform/mac/plugins/jsobjc-simple.html:
* platform/mac/plugins/pluginDocumentView-deallocated-dataSource.html-disabled:
* platform/mac/plugins/root-object-premature-delete-crash.html:
* platform/mac/plugins/supports-carbon-event-model.html:
* platform/mac/plugins/testplugin-onnew-onpaint.html:
* platform/mac/plugins/throw-on-dealloc.html:
* platform/mac/plugins/undefined-property-crash.html:
* platform/mac/plugins/update-widget-from-style-recalc.html:
* platform/mac/plugins/webScriptObject-exception-deadlock.html:
* platform/mac/scrollbars/key-window-not-first-responder.html:
* platform/qt/plugins/application-plugin-plugins-disabled.html:
* platform/win/plugins/call-javascript-that-destroys-plugin.html:
* platform/win/plugins/get-value-netscape-window.html:
* platform/win/plugins/iframe-inside-overflow.html:
* platform/win/plugins/npn-invalidate-rect-invalidates-window.html:
* platform/win/plugins/visibility-hidden.html:
* platform/win/plugins/window-geometry-initialized-before-set-window.html:
* platform/win/plugins/window-region-is-set-to-clip-rect.html:
* platform/win/plugins/windowless-paint-rect-coordinates.html:
* plugins/:
* pointer-lock/lock-fail-responses-expected.txt:
* pointer-lock/lock-fail-responses.html:
* pointer-lock/pointer-lock-api.html:
* pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt:
* pointer-lock/pointerlockchange-pointerlockerror-events.html:
* pointer-lock/pointerlocklost-event-expected.txt:
* pointer-lock/pointerlocklost-event.html:
* printing/compositing-layer-printing.html:
* printing/css2.1/README.txt:
* printing/css2.1/page-break-after-000.html:
* printing/css2.1/page-break-after-001.html:
* printing/css2.1/page-break-after-002.html:
* printing/css2.1/page-break-after-003.html:
* printing/css2.1/page-break-after-004.html:
* printing/css2.1/page-break-before-000.html:
* printing/css2.1/page-break-before-001.html:
* printing/css2.1/page-break-before-002.html:
* printing/css2.1/page-break-inside-000.html:
* printing/iframe-print.html:
* printing/media-queries-print.html:
* printing/numberOfPages-expected.txt:
* printing/page-count-layout-overflow.html:
* printing/page-count-relayout-shrink.html:
* printing/page-count-with-one-word.html:
* printing/page-format-data-display-none.html:
* printing/page-format-data-expected.txt:
* printing/page-format-data.html:
* printing/page-rule-css-text.html:
* printing/page-rule-in-media-query.html:
* printing/page-rule-selection-expected.txt:
* printing/page-rule-selection.html:
* printing/pageNumerForElementById-expected.txt:
* printing/print-close-crash.html:
* printing/pseudo-class-outside-page.html:
* printing/resources/paged-media-test-utils.js:
(pageNumberForElementShouldBe):
(numberOfPagesShouldBe):
(runPrintingTest):
* printing/return-from-printing-mode.html:
* printing/script-tests/numberOfPages.js:
* printing/script-tests/pageNumerForElementById.js:
* printing/setPrinting.html:
* printing/simultaneous-position-float-change.html:
* printing/single-line-must-not-be-split-into-two-pages.html:
* printing/width-overflow.html:
* printing/zoomed-document.html:
* scrollbars/hidden-iframe-scrollbar-crash.html:
* scrollbars/hidden-iframe-scrollbar-crash2.html:
* scrollbars/hidden-scrollbar-prevents-layout.html:
* scrollbars/overflow-custom-scrollbar-crash.html:
* scrollbars/resources/hidden-iframe-scrollbar-crash2.html:
* scrollbars/scroll-rtl-or-bt-layer.html:
* scrollbars/scrollable-iframe-remove-crash.html:
* scrollbars/scrollbar-click-does-not-blur-content.html:
* scrollbars/scrollbar-crash-on-refresh.html:
* scrollbars/scrollbar-drag-thumb-with-large-content.html:
* scrollbars/scrollbar-gradient-crash.html:
* scrollbars/scrollbar-iframe-click-does-not-blur-content.html:
* scrollbars/scrollbar-initial-position.html:
* scrollbars/scrollbar-middleclick-nopaste.html:
* scrollbars/scrollbar-miss-mousemove-disabled.html:
* scrollbars/scrollbar-miss-mousemove.html:
* scrollbars/scrollbar-owning-renderer-crash.html:
* scrollbars/scrollbar-part-created-with-no-parent-crash.html:
* scrollbars/scrollbar-percent-padding-crash.html:
* scrollbars/scrollbar-scrollbarparts-repaint-crash.html:
* scrollbars/scrollevent-iframe-no-scrolling-wheel.html:
* scrollbars/scrollevent-iframe-no-scrolling.html:
* security/autocomplete-cleared-on-back.html:
* security/block-test-no-port.html:
* security/block-test.html:
* security/set-form-autocomplete-attribute.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 08372332
2012-06-15 Ryosuke Niwa <rniwa@webkit.org>
Use testRunner instead of layoutTestController in networkinformation, perf, plugins, pointer-lock, printing, scrollbars, and security tests
https://bugs.webkit.org/show_bug.cgi?id=89181
Reviewed by Kent Tamura.
* perf/clone-with-focus.html:
* perf/nested-combined-selectors.html:
* perf/table-rows-length-caching.html:
* platform/chromium/plugins/call-as-function.html:
* platform/chromium/plugins/get-url-with-blank-target2.html:
* platform/chromium/plugins/get-url-with-iframe-target-no-crash.html:
* platform/chromium/printing/custom-page-size-style-expected.txt:
* platform/chromium/printing/custom-page-size-style.html:
* platform/gtk/plugins/invalidate-rect-with-null-npp-argument.html:
* platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html:
* platform/mac-wk2/plugins/contents-scale-factor.html:
* platform/mac-wk2/plugins/mouse-events-scaled.html:
* platform/mac/plugins/bindings-array-apply-crash.html:
* platform/mac/plugins/bindings-objc-long-method-name.html:
* platform/mac/plugins/bindings-objc-method-name-conversion.html:
* platform/mac/plugins/bindings-test-objc.html:
* platform/mac/plugins/call-as-function-test.html:
* platform/mac/plugins/convert-point.html:
* platform/mac/plugins/disable-plugins.html:
* platform/mac/plugins/jsobjc-dom-wrappers.html:
* platform/mac/plugins/jsobjc-simple.html:
* platform/mac/plugins/pluginDocumentView-deallocated-dataSource.html-disabled:
* platform/mac/plugins/root-object-premature-delete-crash.html:
* platform/mac/plugins/supports-carbon-event-model.html:
* platform/mac/plugins/testplugin-onnew-onpaint.html:
* platform/mac/plugins/throw-on-dealloc.html:
* platform/mac/plugins/undefined-property-crash.html:
* platform/mac/plugins/update-widget-from-style-recalc.html:
* platform/mac/plugins/webScriptObject-exception-deadlock.html:
* platform/mac/scrollbars/key-window-not-first-responder.html:
* platform/qt/plugins/application-plugin-plugins-disabled.html:
* platform/win/plugins/call-javascript-that-destroys-plugin.html:
* platform/win/plugins/get-value-netscape-window.html:
* platform/win/plugins/iframe-inside-overflow.html:
* platform/win/plugins/npn-invalidate-rect-invalidates-window.html:
* platform/win/plugins/visibility-hidden.html:
* platform/win/plugins/window-geometry-initialized-before-set-window.html:
* platform/win/plugins/window-region-is-set-to-clip-rect.html:
* platform/win/plugins/windowless-paint-rect-coordinates.html:
* plugins/:
* pointer-lock/lock-fail-responses-expected.txt:
* pointer-lock/lock-fail-responses.html:
* pointer-lock/pointer-lock-api.html:
* pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt:
* pointer-lock/pointerlockchange-pointerlockerror-events.html:
* pointer-lock/pointerlocklost-event-expected.txt:
* pointer-lock/pointerlocklost-event.html:
* printing/compositing-layer-printing.html:
* printing/css2.1/README.txt:
* printing/css2.1/page-break-after-000.html:
* printing/css2.1/page-break-after-001.html:
* printing/css2.1/page-break-after-002.html:
* printing/css2.1/page-break-after-003.html:
* printing/css2.1/page-break-after-004.html:
* printing/css2.1/page-break-before-000.html:
* printing/css2.1/page-break-before-001.html:
* printing/css2.1/page-break-before-002.html:
* printing/css2.1/page-break-inside-000.html:
* printing/iframe-print.html:
* printing/media-queries-print.html:
* printing/numberOfPages-expected.txt:
* printing/page-count-layout-overflow.html:
* printing/page-count-relayout-shrink.html:
* printing/page-count-with-one-word.html:
* printing/page-format-data-display-none.html:
* printing/page-format-data-expected.txt:
* printing/page-format-data.html:
* printing/page-rule-css-text.html:
* printing/page-rule-in-media-query.html:
* printing/page-rule-selection-expected.txt:
* printing/page-rule-selection.html:
* printing/pageNumerForElementById-expected.txt:
* printing/print-close-crash.html:
* printing/pseudo-class-outside-page.html:
* printing/resources/paged-media-test-utils.js:
(pageNumberForElementShouldBe):
(numberOfPagesShouldBe):
(runPrintingTest):
* printing/return-from-printing-mode.html:
* printing/script-tests/numberOfPages.js:
* printing/script-tests/pageNumerForElementById.js:
* printing/setPrinting.html:
* printing/simultaneous-position-float-change.html:
* printing/single-line-must-not-be-split-into-two-pages.html:
* printing/width-overflow.html:
* printing/zoomed-document.html:
* scrollbars/hidden-iframe-scrollbar-crash.html:
* scrollbars/hidden-iframe-scrollbar-crash2.html:
* scrollbars/hidden-scrollbar-prevents-layout.html:
* scrollbars/overflow-custom-scrollbar-crash.html:
* scrollbars/resources/hidden-iframe-scrollbar-crash2.html:
* scrollbars/scroll-rtl-or-bt-layer.html:
* scrollbars/scrollable-iframe-remove-crash.html:
* scrollbars/scrollbar-click-does-not-blur-content.html:
* scrollbars/scrollbar-crash-on-refresh.html:
* scrollbars/scrollbar-drag-thumb-with-large-content.html:
* scrollbars/scrollbar-gradient-crash.html:
* scrollbars/scrollbar-iframe-click-does-not-blur-content.html:
* scrollbars/scrollbar-initial-position.html:
* scrollbars/scrollbar-middleclick-nopaste.html:
* scrollbars/scrollbar-miss-mousemove-disabled.html:
* scrollbars/scrollbar-miss-mousemove.html:
* scrollbars/scrollbar-owning-renderer-crash.html:
* scrollbars/scrollbar-part-created-with-no-parent-crash.html:
* scrollbars/scrollbar-percent-padding-crash.html:
* scrollbars/scrollbar-scrollbarparts-repaint-crash.html:
* scrollbars/scrollevent-iframe-no-scrolling-wheel.html:
* scrollbars/scrollevent-iframe-no-scrolling.html:
* security/autocomplete-cleared-on-back.html:
* security/block-test-no-port.html:
* security/block-test.html:
* security/set-form-autocomplete-attribute.html:
2012-06-15 Ryosuke Niwa <rniwa@webkit.org>
Use testRunner instead of layoutTestController in ietestcenter, inspector, java, jquery, loader, mathml, media, and mhtml tests
......
......@@ -6,8 +6,8 @@
<div id="console"></div>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
var listElement = document.getElementById('list');
var templateElement = list.firstChild;
......
......@@ -6,8 +6,8 @@
<script src="../resources/magnitude-perf.js"></script>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
var list;
var stack;
......
......@@ -6,8 +6,8 @@
<script src="../resources/magnitude-perf.js"></script>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
var table;
var sandbox = document.getElementById('sandbox');
......
<html>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
function runTest() {
var c = document.getElementById('console');
......
......@@ -11,14 +11,14 @@ function callback(result) {
else
d.innerHTML = "FAILED - got error code " + result
layoutTestController.notifyDone();
testRunner.notifyDone();
}
function runtest() {
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
layoutTestController.setCanOpenWindows();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
// The new window should close immediately after it opens and finishes
// loading. The setTimeout allows NPP_URLNotify to run before the
// window is closed.
......
<html>
<script>
function runtest() {
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
plg.getURLNotify("data:text/html,<body onload='layoutTestController.notifyDone()'></body>", "frame", "callback");
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
plg.getURLNotify("data:text/html,<body onload='testRunner.notifyDone()'></body>", "frame", "callback");
plg.parentNode.removeChild(plg)
} else {
document.write("Cannot run interactively");
......
......@@ -4,9 +4,9 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Test page size: 10in 10in. Page has custom page size style
PASS layoutTestController.hasCustomPageSizeStyle(0) is true
PASS testRunner.hasCustomPageSizeStyle(0) is true
Test page size: auto. Page does not have any custom page size style
PASS layoutTestController.hasCustomPageSizeStyle(0) is false
PASS testRunner.hasCustomPageSizeStyle(0) is false
PASS successfullyParsed is true
......
......@@ -15,21 +15,21 @@
document.getElementById("head_element").appendChild(styleElement);
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
if (window.testRunner) {
testRunner.dumpAsText();
// Page size style tests.
debug("Test page size: 10in 10in. Page has custom page size style");
appendStyle("@page {size:10in 10in;}");
shouldBe("layoutTestController.hasCustomPageSizeStyle(0)", "true");
shouldBe("testRunner.hasCustomPageSizeStyle(0)", "true");
debug("Test page size: auto. Page does not have any custom page size style");
appendStyle("@page {size:auto;}");
shouldBe("layoutTestController.hasCustomPageSizeStyle(0)", "false");
shouldBe("testRunner.hasCustomPageSizeStyle(0)", "false");
debug("");
} else {
testFailed("This test can be run only with window.layoutTestController");
testFailed("This test can be run only with window.testRunner");
}
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
......
......@@ -2,8 +2,8 @@
<html>
<head>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
......
......@@ -46,9 +46,9 @@ div#styled::-webkit-scrollbar-track:horizontal {
</style>
<body style="margin:0">
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
<div id="overflow" style="border:2px solid black;overflow:auto;height:200px;width:200px; left: 0px; top: 100px; position: absolute;">
......@@ -78,7 +78,7 @@ should be 80, and the horizonta 40.<p/>
<script>
function failed() {
document.getElementById('console').innerHTML = "FAILED";
window.layoutTestController.notifyDone();
window.testRunner.notifyDone();
}
if (window.eventSender) {
......@@ -154,7 +154,7 @@ function finished()
// Just to cleanup the test results page
document.getElementById('styled').style.display = 'none';
window.layoutTestController.notifyDone();
window.testRunner.notifyDone();
}
</script>
......
......@@ -16,12 +16,12 @@ function createTestPlugin(testName)
function runTest()
{
if (!window.layoutTestController) {
if (!window.testRunner) {
debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
return;
}
layoutTestController.waitUntilDone();
testRunner.waitUntilDone();
plugin1 = createTestPlugin('contents-scale-factor');
document.body.appendChild(plugin1);
......@@ -30,7 +30,7 @@ function runTest()
shouldBe("plugin1.cachedContentsScaleFactor", "1.0");
// Now change the backing scale factor.
layoutTestController.setBackingScaleFactor(2, function() {
testRunner.setBackingScaleFactor(2, function() {
shouldBe("plugin1.contentsScaleFactor", "2.0");
shouldBe("plugin1.cachedContentsScaleFactor", "2.0");
......@@ -40,7 +40,7 @@ function runTest()
shouldBe("plugin2.contentsScaleFactor", "2.0");
shouldBe("plugin2.cachedContentsScaleFactor", "2.0");
layoutTestController.notifyDone();
testRunner.notifyDone();
});
}
</script>
......
......@@ -9,10 +9,10 @@ function fakeClick(x, y) {
eventSender.mouseUp();
}
if (!window.layoutTestController)
if (!window.testRunner)
document.write("This test does not work in manual mode.");
else {
layoutTestController.dumpAsText();
testRunner.dumpAsText();
plg.windowedPlugin = false;
plg.eventLoggingEnabled = true;
......
......@@ -8,8 +8,8 @@ function log(msg)
document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
}
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
if (!window.objCController)
alert("This needs to be run under DRT on the Mac.");
......
......@@ -5,8 +5,8 @@
var methodName = '';
function doTest()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
for (var i = 0; i < 1024; ++i)
methodName += 'long';
......
......@@ -5,8 +5,8 @@
var methodName = '';
function doTest()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
shouldBeEqualToString("objCPlugin['testConversionColon_'](1)", 'testConversionColon:(int)useless');
shouldBeEqualToString("objCPlugin['testConversionEscapeChar$$a$_b$$$__'](2)", 'testConversionEscapeChar$a_b$_:(int)useless');
......
......@@ -3,8 +3,8 @@
<script>
function doTest()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
if (window.objCPlugin) {
// Type should be "object"
......
......@@ -3,11 +3,11 @@
<script>
function doTest()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
// Test calling bridged function with global window as "this"
var f = ("layoutTestController" in window) ? objCController.className : console.log;
var f = ("testRunner" in window) ? objCController.className : console.log;
var result;
try {
......
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
......
<script>
function runTest() {
if (!window.layoutTestController)
if (!window.testRunner)
alert('this test must be run from DumpRenderTree')
layoutTestController.dumpAsText();
layoutTestController.setPluginsEnabled(false);
testRunner.dumpAsText();
testRunner.setPluginsEnabled(false);
var pluginElement = document.getElementById('testPlugin');
pluginElement.parentNode.removeChild(pluginElement);
......
......@@ -17,8 +17,8 @@ function check(exp, value) {
print('' + exp + ' == ' + value + ' ? -> ' + result);
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
if (!window.objCPlugin)
return print('FAIL - no objCPlugin');
objCPlugin.removeBridgeRestrictions_(window);
......
......@@ -8,8 +8,8 @@ function print(message) {
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
if (!window.objCPlugin)
return print('FAIL - no objCPlugin');
objCPlugin.removeBridgeRestrictions_(window);
......
......@@ -4,15 +4,15 @@
function finishTest()
{
document.getElementById('plugin').src = 'about:blank';
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
function test()
{
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
var i = 0;
......@@ -24,8 +24,8 @@ function test()
}
if (!found) {
document.getElementById("result").innerText = "Test cannot run: QuickTime Plugin.webplugin missing.";
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
return;
}
setTimeout(finishTest, 0);
......
......@@ -30,7 +30,7 @@ function runTest()
}
log("PASS: You didn't crash.\n");
layoutTestController.notifyDone();
testRunner.notifyDone();
}
function queueTest()
......@@ -43,12 +43,12 @@ function queueTest()
function timeoutTest()
{
log("FAIL: Test timed-out after " + count + " runs.\n");
layoutTestController.notifyDone();
testRunner.notifyDone();
}
window.onload = function onload()
{
if (!("layoutTestController" in window) || !("objCController" in window)) {
if (!("testRunner" in window) || !("objCController" in window)) {
var errorMessage = "FAIL: This test can only run inside DumpRenderTree on the mac.";
log(errorMessage);
throw errorMessage;
......@@ -56,8 +56,8 @@ window.onload = function onload()
timeoutIdentifier = setTimeout(timeoutTest, 30000); // timeout after 30 seconds
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
testRunner.dumpAsText();
testRunner.waitUntilDone();
queueTest();
}
......
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
</script>