Userscripts on special documents should be tested
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Aug 2010 22:54:04 +0000 (22:54 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Aug 2010 22:54:04 +0000 (22:54 +0000)
<https://bugs.webkit.org/show_bug.cgi?id=44725>

Reviewed by Dave Hyatt.

Add tests of user script injection in audio, image, plugin, and video documents.

* userscripts/user-script-audio-document.html: Added. Test injection of user scripts
    in an audio document.
* userscripts/user-script-audio-document-expected.txt: Added.
* userscripts/user-script-image-document.html: Added. Test injection of user scripts
    in an image document.
* userscripts/user-script-image-document-expected.txt: Added.
* userscripts/user-script-plugin-document.html: Added. Test injection of user scripts
    in a plugin document.
* userscripts/user-script-plugin-document-expected.txt: Added.
* userscripts/user-script-video-document.html: Added. Test injection of user scripts
    in a video document.
* userscripts/user-script-video-document-expected.txt: Added.

* userscripts/resources/abe.png: Copied from media/content/abe.png.
* userscripts/resources/counting.mp4: Copied from media/content/counting.mp4.
* userscripts/resources/test.wav: Copied from media/content/test.wav.

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/userscripts/resources/abe.png [new file with mode: 0644]
LayoutTests/userscripts/resources/counting.mp4 [new file with mode: 0644]
LayoutTests/userscripts/resources/test.wav [new file with mode: 0644]
LayoutTests/userscripts/user-script-audio-document-expected.txt [new file with mode: 0644]
LayoutTests/userscripts/user-script-audio-document.html [new file with mode: 0644]
LayoutTests/userscripts/user-script-image-document-expected.txt [new file with mode: 0644]
LayoutTests/userscripts/user-script-image-document.html [new file with mode: 0644]
LayoutTests/userscripts/user-script-plugin-document-expected.txt [new file with mode: 0644]
LayoutTests/userscripts/user-script-plugin-document.html [new file with mode: 0644]
LayoutTests/userscripts/user-script-video-document-expected.txt [new file with mode: 0644]
LayoutTests/userscripts/user-script-video-document.html [new file with mode: 0644]

index 6cfae1d..0243a6e 100644 (file)
@@ -1,3 +1,29 @@
+2010-08-26  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Userscripts on special documents should be tested
+        <https://bugs.webkit.org/show_bug.cgi?id=44725>
+        
+        Add tests of user script injection in audio, image, plugin, and video documents.
+        
+        * userscripts/user-script-audio-document.html: Added. Test injection of user scripts
+            in an audio document.
+        * userscripts/user-script-audio-document-expected.txt: Added.
+        * userscripts/user-script-image-document.html: Added. Test injection of user scripts
+            in an image document.
+        * userscripts/user-script-image-document-expected.txt: Added.
+        * userscripts/user-script-plugin-document.html: Added. Test injection of user scripts
+            in a plugin document.
+        * userscripts/user-script-plugin-document-expected.txt: Added.
+        * userscripts/user-script-video-document.html: Added. Test injection of user scripts
+            in a video document.
+        * userscripts/user-script-video-document-expected.txt: Added.
+        
+        * userscripts/resources/abe.png: Copied from media/content/abe.png.
+        * userscripts/resources/counting.mp4: Copied from media/content/counting.mp4.
+        * userscripts/resources/test.wav: Copied from media/content/test.wav.
+
 2010-08-26  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Dave Hyatt.
diff --git a/LayoutTests/userscripts/resources/abe.png b/LayoutTests/userscripts/resources/abe.png
new file mode 100644 (file)
index 0000000..c932536
Binary files /dev/null and b/LayoutTests/userscripts/resources/abe.png differ
diff --git a/LayoutTests/userscripts/resources/counting.mp4 b/LayoutTests/userscripts/resources/counting.mp4
new file mode 100644 (file)
index 0000000..5fbd6d9
Binary files /dev/null and b/LayoutTests/userscripts/resources/counting.mp4 differ
diff --git a/LayoutTests/userscripts/resources/test.wav b/LayoutTests/userscripts/resources/test.wav
new file mode 100644 (file)
index 0000000..e46e57d
Binary files /dev/null and b/LayoutTests/userscripts/resources/test.wav differ
diff --git a/LayoutTests/userscripts/user-script-audio-document-expected.txt b/LayoutTests/userscripts/user-script-audio-document-expected.txt
new file mode 100644 (file)
index 0000000..f1e8cf6
--- /dev/null
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+
diff --git a/LayoutTests/userscripts/user-script-audio-document.html b/LayoutTests/userscripts/user-script-audio-document.html
new file mode 100644 (file)
index 0000000..97e6818
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    window.layoutTestController.dumpAsText();
+    window.layoutTestController.addUserScript("console.log('Start Script')", true, true);
+    window.layoutTestController.addUserScript("console.log('End Script')", false, true);
+}
+</script>
+</head>
+<body>
+<iframe src="resources/test.wav"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/userscripts/user-script-image-document-expected.txt b/LayoutTests/userscripts/user-script-image-document-expected.txt
new file mode 100644 (file)
index 0000000..f1e8cf6
--- /dev/null
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+
diff --git a/LayoutTests/userscripts/user-script-image-document.html b/LayoutTests/userscripts/user-script-image-document.html
new file mode 100644 (file)
index 0000000..0137ce6
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    window.layoutTestController.dumpAsText();
+    window.layoutTestController.addUserScript("console.log('Start Script')", true, true);
+    window.layoutTestController.addUserScript("console.log('End Script')", false, true);
+}
+</script>
+</head>
+<body>
+<iframe src="resources/abe.png"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/userscripts/user-script-plugin-document-expected.txt b/LayoutTests/userscripts/user-script-plugin-document-expected.txt
new file mode 100644 (file)
index 0000000..f1e8cf6
--- /dev/null
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+
diff --git a/LayoutTests/userscripts/user-script-plugin-document.html b/LayoutTests/userscripts/user-script-plugin-document.html
new file mode 100644 (file)
index 0000000..d6c36d6
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    window.layoutTestController.dumpAsText();
+    window.layoutTestController.addUserScript("console.log('Start Script')", true, true);
+    window.layoutTestController.addUserScript("console.log('End Script')", false, true);
+}
+</script>
+</head>
+<body>
+<iframe src="data:application/x-webkit-test-netscape,"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/userscripts/user-script-video-document-expected.txt b/LayoutTests/userscripts/user-script-video-document-expected.txt
new file mode 100644 (file)
index 0000000..f1e8cf6
--- /dev/null
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+CONSOLE MESSAGE: line 1: Start Script
+CONSOLE MESSAGE: line 1: End Script
+
diff --git a/LayoutTests/userscripts/user-script-video-document.html b/LayoutTests/userscripts/user-script-video-document.html
new file mode 100644 (file)
index 0000000..2119fa9
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    window.layoutTestController.dumpAsText();
+    window.layoutTestController.addUserScript("console.log('Start Script')", true, true);
+    window.layoutTestController.addUserScript("console.log('End Script')", false, true);
+}
+</script>
+</head>
+<body>
+<iframe src="resources/counting.mp4"></iframe>
+</body>
+</html>