Add layout tests for test cases in Bug 5206
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 16:33:31 +0000 (16:33 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 16:33:31 +0000 (16:33 +0000)
<http://webkit.org/b/5206>

Reviewed by Eric Seidel.

These issues were likely fixed in r89257 for Bug 62613.

* fast/js/parse-error-external-script-in-eval-expected.txt: Added.
* fast/js/parse-error-external-script-in-eval.html: Added.
* fast/js/parse-error-external-script-in-new-Function-expected.txt: Added.
Note that the line number in this result is relative to the line
number of the second argument to the new Function() method.
* fast/js/parse-error-external-script-in-new-Function.html: Added.
* fast/js/resources/parse-error-external-script-in-eval.js: Added.
* fast/js/resources/parse-error-external-script-in-new-Function.js: Added.

* platform/chromium/fast/js/parse-error-external-script-in-eval-expected.txt: Added.
* platform/chromium/fast/js/parse-error-external-script-in-new-Function-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149743 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/js/parse-error-external-script-in-eval-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/parse-error-external-script-in-eval.html [new file with mode: 0644]
LayoutTests/fast/js/parse-error-external-script-in-new-Function-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/parse-error-external-script-in-new-Function.html [new file with mode: 0644]
LayoutTests/fast/js/resources/parse-error-external-script-in-eval.js [new file with mode: 0644]
LayoutTests/fast/js/resources/parse-error-external-script-in-new-Function.js [new file with mode: 0644]
LayoutTests/platform/chromium/fast/js/parse-error-external-script-in-eval-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/js/parse-error-external-script-in-new-Function-expected.txt [new file with mode: 0644]

index a46d74d..76b4e28 100644 (file)
@@ -1,3 +1,24 @@
+2013-05-08  David Kilzer  <ddkilzer@apple.com>
+
+        Add layout tests for test cases in Bug 5206
+        <http://webkit.org/b/5206>
+
+        Reviewed by Eric Seidel.
+
+        These issues were likely fixed in r89257 for Bug 62613.
+
+        * fast/js/parse-error-external-script-in-eval-expected.txt: Added.
+        * fast/js/parse-error-external-script-in-eval.html: Added.
+        * fast/js/parse-error-external-script-in-new-Function-expected.txt: Added.
+        Note that the line number in this result is relative to the line
+        number of the second argument to the new Function() method.
+        * fast/js/parse-error-external-script-in-new-Function.html: Added.
+        * fast/js/resources/parse-error-external-script-in-eval.js: Added.
+        * fast/js/resources/parse-error-external-script-in-new-Function.js: Added.
+
+        * platform/chromium/fast/js/parse-error-external-script-in-eval-expected.txt: Added.
+        * platform/chromium/fast/js/parse-error-external-script-in-new-Function-expected.txt: Added.
+
 2013-05-08  Eric Carlson  <eric.carlson@apple.com>
 
         [Mac] Inband text tracks are not in track menu on Lion
diff --git a/LayoutTests/fast/js/parse-error-external-script-in-eval-expected.txt b/LayoutTests/fast/js/parse-error-external-script-in-eval-expected.txt
new file mode 100644 (file)
index 0000000..325243d
--- /dev/null
@@ -0,0 +1,2 @@
+CONSOLE MESSAGE: line 2: SyntaxError: Expected an identifier but found 'error' instead
+This tests that a line number and error message is printed for a parse error in a separate source file using eval().
diff --git a/LayoutTests/fast/js/parse-error-external-script-in-eval.html b/LayoutTests/fast/js/parse-error-external-script-in-eval.html
new file mode 100644 (file)
index 0000000..dcf952f
--- /dev/null
@@ -0,0 +1,19 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+</script>
+<script src="resources/parse-error-external-script-in-eval.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.notifyDone();
+}
+</script>
+</head>
+<body>
+This tests that a line number and error message is printed for a parse error in a separate source file using eval().
+</body>
+</html>
diff --git a/LayoutTests/fast/js/parse-error-external-script-in-new-Function-expected.txt b/LayoutTests/fast/js/parse-error-external-script-in-new-Function-expected.txt
new file mode 100644 (file)
index 0000000..56d4304
--- /dev/null
@@ -0,0 +1,2 @@
+CONSOLE MESSAGE: line 3: SyntaxError: Expected an identifier but found 'error' instead
+This tests that a line number and error message is printed for a parse error in a separate source file using new Function().
diff --git a/LayoutTests/fast/js/parse-error-external-script-in-new-Function.html b/LayoutTests/fast/js/parse-error-external-script-in-new-Function.html
new file mode 100644 (file)
index 0000000..325697e
--- /dev/null
@@ -0,0 +1,19 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+</script>
+<script src="resources/parse-error-external-script-in-new-Function.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.notifyDone();
+}
+</script>
+</head>
+<body>
+This tests that a line number and error message is printed for a parse error in a separate source file using new Function().
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/parse-error-external-script-in-eval.js b/LayoutTests/fast/js/resources/parse-error-external-script-in-eval.js
new file mode 100644 (file)
index 0000000..c1f665e
--- /dev/null
@@ -0,0 +1,3 @@
+
+eval("\n\nsyntax error");
+
diff --git a/LayoutTests/fast/js/resources/parse-error-external-script-in-new-Function.js b/LayoutTests/fast/js/resources/parse-error-external-script-in-new-Function.js
new file mode 100644 (file)
index 0000000..132bc4c
--- /dev/null
@@ -0,0 +1,3 @@
+
+var f = new Function("x", "\n\nsyntax error");
+
diff --git a/LayoutTests/platform/chromium/fast/js/parse-error-external-script-in-eval-expected.txt b/LayoutTests/platform/chromium/fast/js/parse-error-external-script-in-eval-expected.txt
new file mode 100644 (file)
index 0000000..d0d0e11
--- /dev/null
@@ -0,0 +1,2 @@
+CONSOLE MESSAGE: line 3: Uncaught SyntaxError: Unexpected identifier
+This tests that a line number and error message is printed for a parse error in a separate source file using eval().
diff --git a/LayoutTests/platform/chromium/fast/js/parse-error-external-script-in-new-Function-expected.txt b/LayoutTests/platform/chromium/fast/js/parse-error-external-script-in-new-Function-expected.txt
new file mode 100644 (file)
index 0000000..ef36360
--- /dev/null
@@ -0,0 +1,2 @@
+CONSOLE MESSAGE: line 4: Uncaught SyntaxError: Unexpected identifier
+This tests that a line number and error message is printed for a parse error in a separate source file using new Function().