[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
ap at apple.com
ap at apple.com
Wed Mar 17 17:57:56 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 4e776ca7013b647e625a8455c6dab6b5f2223d83
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Feb 24 01:22:36 2010 +0000
Reviewed by Mark Rowe.
https://bugs.webkit.org/show_bug.cgi?id=22602
Enable Java in DumpRenderTree (on Mac)
LayoutTests:
* fast/dom/java-applet-calls-expected.txt: Removed.
* fast/dom/java-applet-calls.html: Removed.
* fast/dom/resources/TestApplet.class: Removed.
* fast/dom/resources/TestApplet.java: Removed.
This test was added in a failing form, even though it never worked. The new tests cover
everything it was meant to cover.
* java/SharedApplet.java: Added. This class will have methods for simple tests, but it's
also possible to just add new source files.
* java/Makefile: Added. Compile all .java files in the directory.
* java: Added.
* java/argument-to-object-type-expected.txt: Added.
* java/argument-to-object-type.html: Added.
* java/array-return-expected.txt: Added.
* java/array-return.html: Added.
Added tests for recently fixed bugs.
* platform/gtk/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
Java tests only work on Mac currently.
WebKitTools:
* DumpRenderTree/mac/DumpRenderTree.mm:
(exitApplicationRunLoop):
(dump):
(runTest):
DumpRenderTree now runs an NSApplication, not just an event loop. This way, the Java plug-in
can start without freezing.
* Scripts/run-webkit-tests: Compile java sources in LayputTests/java.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 87b27a8..763a9e2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,34 @@
+2010-02-23 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22602
+ Enable Java in DumpRenderTree (on Mac)
+
+ * fast/dom/java-applet-calls-expected.txt: Removed.
+ * fast/dom/java-applet-calls.html: Removed.
+ * fast/dom/resources/TestApplet.class: Removed.
+ * fast/dom/resources/TestApplet.java: Removed.
+ This test was added in a failing form, even though it never worked. The new tests cover
+ everything it was meant to cover.
+
+ * java/SharedApplet.java: Added. This class will have methods for simple tests, but it's
+ also possible to just add new source files.
+
+ * java/Makefile: Added. Compile all .java files in the directory.
+
+ * java: Added.
+ * java/argument-to-object-type-expected.txt: Added.
+ * java/argument-to-object-type.html: Added.
+ * java/array-return-expected.txt: Added.
+ * java/array-return.html: Added.
+ Added tests for recently fixed bugs.
+
+ * platform/gtk/Skipped:
+ * platform/qt/Skipped:
+ * platform/win/Skipped:
+ Java tests only work on Mac currently.
+
2010-02-23 Oliver Hunt <oliver at apple.com>
Add expected result
diff --git a/LayoutTests/fast/dom/java-applet-calls-expected.txt b/LayoutTests/fast/dom/java-applet-calls-expected.txt
deleted file mode 100644
index 6011391..0000000
--- a/LayoutTests/fast/dom/java-applet-calls-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Requires Java plugin installed and enabled. This tests that calling functions on Java Applet works.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
- FAIL document.testapplet.getString() == 'abcdefg' should be true. Threw exception TypeError: Result of expression 'document.testapplet.getString' [undefined] is not a function.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/dom/java-applet-calls.html b/LayoutTests/fast/dom/java-applet-calls.html
deleted file mode 100644
index 6b6f0f3..0000000
--- a/LayoutTests/fast/dom/java-applet-calls.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<html>
-<head>
-<link rel="stylesheet" href="../js/resources/js-test-style.css">
-<script src="../js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-
-<APPLET CODEBASE="resources" CODE="TestApplet" WIDTH=1 HEIGHT=1 NAME="testapplet">
-</APPLET>
-
-<div id="console"></div>
-
-<script>
-description('Requires Java plugin installed and enabled. This tests that calling functions on Java Applet works.');
-
-try {
- document.testapplet.setString("abcdefg");
-} catch (e) {
- // Do nothing.
-}
-
-// The applet may return 'abcdefg' as an object rather than a string, so
-// we'll let JavaScript do the comparison before evaluating it.
-shouldBeTrue("document.testapplet.getString() == 'abcdefg'");
-
-var successfullyParsed = true;
-</script>
-<script src="../js/resources/js-test-post.js"></script>
-</body>
-</html>
-
-
-
diff --git a/LayoutTests/fast/dom/resources/TestApplet.class b/LayoutTests/fast/dom/resources/TestApplet.class
deleted file mode 100644
index 766faf6..0000000
Binary files a/LayoutTests/fast/dom/resources/TestApplet.class and /dev/null differ
diff --git a/LayoutTests/fast/dom/resources/TestApplet.java b/LayoutTests/fast/dom/resources/TestApplet.java
deleted file mode 100644
index ea254a0..0000000
--- a/LayoutTests/fast/dom/resources/TestApplet.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* Source for a test applet used by layout tests. */
-
-import java.applet.*;
-
-public class TestApplet extends Applet {
- private String str;
-
- public void init() {}
-
- public void setString(String str) {
- this.str = str;
- }
-
- public String getString() {
- return str;
- }
-}
diff --git a/LayoutTests/java/Makefile b/LayoutTests/java/Makefile
new file mode 100644
index 0000000..f734057
--- /dev/null
+++ b/LayoutTests/java/Makefile
@@ -0,0 +1,40 @@
+# Copyright (C) 2010 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS “AS IS”
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+JC = javac
+JFLAGS =
+.SUFFIXES: .java .class
+
+.java.class:
+ $(JC) $(JFLAGS) $*.java
+
+CLASSES = $(wildcard *.java)
+
+default: classes
+
+classes: $(CLASSES:.java=.class)
+
+clean:
+ $(RM) *.class
diff --git a/LayoutTests/java/SharedApplet.java b/LayoutTests/java/SharedApplet.java
new file mode 100644
index 0000000..3072a91
--- /dev/null
+++ b/LayoutTests/java/SharedApplet.java
@@ -0,0 +1,21 @@
+import java.applet.Applet;
+import java.util.*;
+
+public class SharedApplet extends Applet
+{
+ public String objectToString(Object obj) {
+ return obj.toString();
+ }
+
+ public String[] stringArray() {
+ return new String[] { "One", "Two", "Three" };
+ }
+
+ public List<String> stringList() {
+ List<String> result = new ArrayList<String>();
+ result.add("One");
+ result.add("Two");
+ result.add("Three");
+ return result;
+ }
+}
diff --git a/LayoutTests/java/argument-to-object-type-expected.txt b/LayoutTests/java/argument-to-object-type-expected.txt
new file mode 100644
index 0000000..2d5a936
--- /dev/null
+++ b/LayoutTests/java/argument-to-object-type-expected.txt
@@ -0,0 +1,9 @@
+Test for bug 35202: Calling Java method which accepts Object always passes a null argument.
+
+PASS document.javaTest.objectToString("PАSS") == "PАSS" is true
+PASS document.javaTest.objectToString(undefined) == "undefined" is true
+PASS document.javaTest.objectToString(5) == "5.0" is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/argument-to-object-type.html b/LayoutTests/java/argument-to-object-type.html
new file mode 100644
index 0000000..797c7de
--- /dev/null
+++ b/LayoutTests/java/argument-to-object-type.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script src="../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController)
+ layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+</script>
+</head>
+<body>
+
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=35202">bug 35202</a>:
+Calling Java method which accepts Object always passes a null argument.</p>
+
+<div id="console"></div>
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+<APPLET CODE="SharedApplet.class" NAME="javaTest" WIDTH=150 HEIGHT=25 MAYSCRIPT></APPLET>
+<script>
+
+// The returned result should be a primitive, but WebKit makes a string object out of it.
+// Until this is fixed, checking the result with == instead of relying on shouldBe.
+shouldBe('document.javaTest.objectToString("PАSS") == "PАSS"', 'true');
+shouldBe('document.javaTest.objectToString(undefined) == "undefined"', 'true');
+shouldBe('document.javaTest.objectToString(5) == "5.0"', 'true');
+
+successfullyParsed = true;
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/java/array-return-expected.txt b/LayoutTests/java/array-return-expected.txt
new file mode 100644
index 0000000..c1d3bbd
--- /dev/null
+++ b/LayoutTests/java/array-return-expected.txt
@@ -0,0 +1,10 @@
+Test for bug 23742: Applet methods can not return arrays to JS.
+
+PASS stringArray.length is 3
+PASS stringArray[0] == "One" is true
+PASS stringList.getClass().getSimpleName() == "ArrayList" is true
+PASS stringList.get(0) == "One" is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/array-return.html b/LayoutTests/java/array-return.html
new file mode 100644
index 0000000..47f44b0
--- /dev/null
+++ b/LayoutTests/java/array-return.html
@@ -0,0 +1,33 @@
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script src="../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController)
+ layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+</script>
+</head>
+<body>
+
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=23742">bug 23742</a>:
+Applet methods can not return arrays to JS.</p>
+
+<div id="console"></div>
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+<APPLET CODE="SharedApplet.class" NAME="javaTest" WIDTH=150 HEIGHT=25 MAYSCRIPT></APPLET>
+<script>
+
+var stringArray = document.javaTest.stringArray();
+var stringList = document.javaTest.stringList();
+
+shouldBe('stringArray.length', '3');
+shouldBe('stringArray[0] == "One"', 'true');
+shouldBe('stringList.getClass().getSimpleName() == "ArrayList"', 'true');
+shouldBe('stringList.get(0) == "One"', 'true');
+
+successfullyParsed = true;
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index d122c2e..bf80c17 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5881,3 +5881,5 @@ fast/forms/restore-selection-after-layout.html
# See https://bugs.webkit.org/show_bug.cgi?id=35300
http/tests/loading/307-after-303-after-post.html
+# DumpRenderTree code to enable Java is currently a no-op
+java
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 341b8d3..44a25eb 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5091,3 +5091,6 @@ editing/selection/extend-after-mouse-selection.html
# Needs to make sure the redirect-chain scenario in https://bugs.webkit.org/show_bug.cgi?id=31410 works
# See https://bugs.webkit.org/show_bug.cgi?id=35301
http/tests/loading/307-after-303-after-post.html
+
+# DumpRenderTree code to enable Java is currently a no-op
+java
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 18ebb68..763d7d8 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -764,3 +764,6 @@ websocket/tests/simple-stress.html
# Needs platform specific API implemented in DRT, probably not relevant for non-Mac and non-Windows ports
fast/loader/api-test-new-window-data-load-base-url.html
+
+# DumpRenderTree code to enable Java is currently a no-op. Windows doesn't come with Java by default.
+java
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 191f82c..e91b0d2 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,19 @@
+2010-02-23 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22602
+ Enable Java in DumpRenderTree (on Mac)
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (exitApplicationRunLoop):
+ (dump):
+ (runTest):
+ DumpRenderTree now runs an NSApplication, not just an event loop. This way, the Java plug-in
+ can start without freezing.
+
+ * Scripts/run-webkit-tests: Compile java sources in LayputTests/java.
+
2010-02-23 Jesus Sanchez-Palencia <jesus.palencia at openbossa.org>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index f494b01..6b128df 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -581,6 +581,14 @@ static void runTestingServerLoop()
}
}
+static void exitApplicationRunLoop()
+{
+ [[NSApplication sharedApplication] stop:nil];
+
+ // -[NSApplication run] is blocked in a run loop waiting for an event, need to wake it up to return.
+ [[NSApplication sharedApplication] postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0 windowNumber:0 context:0 subtype:0 data1:0 data2:0] atStart:NO];
+}
+
static void prepareConsistentTestingEnvironment()
{
poseAsClass("DumpRenderTreePasteboard", "NSPasteboard");
@@ -1109,6 +1117,7 @@ void dump()
fflush(stderr);
done = YES;
+ exitApplicationRunLoop();
}
static bool shouldLogFrameLoadDelegates(const char* pathOrURL)
@@ -1225,11 +1234,11 @@ static void runTest(const string& testPathOrURL)
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[mainFrame loadRequest:[NSURLRequest requestWithURL:url]];
[pool release];
- while (!done) {
- pool = [[NSAutoreleasePool alloc] init];
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
- [pool release];
- }
+
+ pool = [[NSAutoreleasePool alloc] init];
+ [[NSApplication sharedApplication] run];
+ ASSERT(done);
+ [pool release];
pool = [[NSAutoreleasePool alloc] init];
[EventSendingController clearSavedEvents];
diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests
index 809e078..7126bf7 100755
--- a/WebKitTools/Scripts/run-webkit-tests
+++ b/WebKitTools/Scripts/run-webkit-tests
@@ -398,6 +398,16 @@ $expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitE
$testResultsDirectory = File::Spec->rel2abs($testResultsDirectory);
my $testResults = File::Spec->catfile($testResultsDirectory, "results.html");
+if (isAppleMacWebKit()) {
+ print STDERR "Compiling Java tests\n";
+ my $javaTestsDirectory = catdir($testDirectory, "java");
+
+ if (system("/usr/bin/make", "-C", "$javaTestsDirectory")) {
+ exit 1;
+ }
+}
+
+
print "Running tests from $testDirectory\n";
if ($pixelTests) {
print "Enabling pixel tests with a tolerance of $tolerance%\n";
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list