- Revision
- 123978
- Author
- commit-qu...@webkit.org
- Date
- 2012-07-29 02:49:14 -0700 (Sun, 29 Jul 2012)
Log Message
Extend `application/x-webkit-test-netscape` plugins to better support multiple frames.
https://bugs.webkit.org/show_bug.cgi?id=92478
Patch by Mike West <mk...@chromium.org> on 2012-07-29
Reviewed by Adam Barth.
Tools:
DumpRenderTree currently understands
`<object src=""
It would be useful if it understood `logifloaded`, which could give
more context regarding test expectations, and can be written in such
as way as to support plugins loaded into multiple iframes in a single
test.
* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(NPP_New):
Adding support for `logifloaded`.
LayoutTests:
* http/tests/plugins/resources/mock-plugin-logger.js:
Exciting JS "framework" for use when logging via `logifloaded`.
* http/tests/security/contentSecurityPolicy/object-src-none-allowed.html:
* http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.html:
* http/tests/security/contentSecurityPolicy/object-src-none-blocked.html:
* http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.html:
Adjusting these tests to use the newly created `logifloaded` plugin mock.
* http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl:
Loading `mock-plugin-logger.js`, and adding a `log` attribute for `logifloaded`.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (123977 => 123978)
--- trunk/LayoutTests/ChangeLog 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/LayoutTests/ChangeLog 2012-07-29 09:49:14 UTC (rev 123978)
@@ -1,3 +1,20 @@
+2012-07-29 Mike West <mk...@chromium.org>
+
+ Extend `application/x-webkit-test-netscape` plugins to better support multiple frames.
+ https://bugs.webkit.org/show_bug.cgi?id=92478
+
+ Reviewed by Adam Barth.
+
+ * http/tests/plugins/resources/mock-plugin-logger.js:
+ Exciting JS "framework" for use when logging via `logifloaded`.
+ * http/tests/security/contentSecurityPolicy/object-src-none-allowed.html:
+ * http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.html:
+ * http/tests/security/contentSecurityPolicy/object-src-none-blocked.html:
+ * http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.html:
+ Adjusting these tests to use the newly created `logifloaded` plugin mock.
+ * http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl:
+ Loading `mock-plugin-logger.js`, and adding a `log` attribute for `logifloaded`.
+
2012-07-28 Dan Bernstein <m...@apple.com>
Hit test results are wrong in flipped blocks writing modes with block column axis
Added: trunk/LayoutTests/http/tests/plugins/resources/mock-plugin-logger.js (0 => 123978)
--- trunk/LayoutTests/http/tests/plugins/resources/mock-plugin-logger.js (rev 0)
+++ trunk/LayoutTests/http/tests/plugins/resources/mock-plugin-logger.js 2012-07-29 09:49:14 UTC (rev 123978)
@@ -0,0 +1,12 @@
+function xWebkitTestNetscapeLog(str) {
+ var console = document.getElementById('xWebkitTestNetscapeConsole');
+ if (!console) {
+ console = document.createElement('div');
+ console.id = 'xWebkitTestNetscapeConsole';
+ document.body.insertBefore(console, document.body.childNodes[0])
+ }
+
+ var text = document.createElement('p');
+ text.appendChild(document.createTextNode(str));
+ console.appendChild(text);
+}
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.txt (123977 => 123978)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.txt 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.txt 2012-07-29 09:49:14 UTC (rev 123978)
@@ -1,7 +1,8 @@
-ALERT: Plugin Loaded!
--------
Frame: '<!--framePath //<!--frame0-->-->'
--------
+PASS!
+
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed.html (123977 => 123978)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed.html 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed.html 2012-07-29 09:49:14 UTC (rev 123978)
@@ -9,6 +9,6 @@
</script>
</head>
<body>
- <iframe src=""
+ <iframe src=""
</body>
</html>
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt (123977 => 123978)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt 2012-07-29 09:49:14 UTC (rev 123978)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: Refused to load the object 'data:application/x-webkit-test-netscape,alertwhenloaded' because it violates the following Content Security Policy directive: "object-src 'none'".
+CONSOLE MESSAGE: Refused to load the object 'data:application/x-webkit-test-netscape,logifloaded' because it violates the following Content Security Policy directive: "object-src 'none'".
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked.html (123977 => 123978)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked.html 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked.html 2012-07-29 09:49:14 UTC (rev 123978)
@@ -9,6 +9,6 @@
</script>
</head>
<body>
- <iframe src=""
+ <iframe src=""
</body>
</html>
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl (123977 => 123978)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl 2012-07-29 09:49:14 UTC (rev 123978)
@@ -10,6 +10,7 @@
print "<!DOCTYPE html>\n";
print "<html>\n";
print "<body>\n";
-print "<object data=""
+print "<script src=""
+print "<object data="" log=\"".$cgi->param('log')."\"></object>\n";
print "</body>\n";
print "</html>\n";
Modified: trunk/Tools/ChangeLog (123977 => 123978)
--- trunk/Tools/ChangeLog 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/Tools/ChangeLog 2012-07-29 09:49:14 UTC (rev 123978)
@@ -1,3 +1,21 @@
+2012-07-29 Mike West <mk...@chromium.org>
+
+ Extend `application/x-webkit-test-netscape` plugins to better support multiple frames.
+ https://bugs.webkit.org/show_bug.cgi?id=92478
+
+ Reviewed by Adam Barth.
+
+ DumpRenderTree currently understands
+ `<object src=""
+ It would be useful if it understood `logifloaded`, which could give
+ more context regarding test expectations, and can be written in such
+ as way as to support plugins loaded into multiple iframes in a single
+ test.
+
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
+ Adding support for `logifloaded`.
+
2012-07-28 Peter Kasting <pkast...@google.com>
Fix Chromium/Win compile.
Modified: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp (123977 => 123978)
--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp 2012-07-29 04:59:30 UTC (rev 123977)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp 2012-07-29 09:49:14 UTC (rev 123978)
@@ -202,7 +202,18 @@
else if (strcasecmp(argn[i], "src") == 0 &&
strcasecmp(argv[i], "data:application/x-webkit-test-netscape,alertwhenloaded") == 0)
executeScript(obj, "alert('Plugin Loaded!')");
- else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
+ else if (strcasecmp(argn[i], "src") == 0 &&
+ strcasecmp(argv[i], "data:application/x-webkit-test-netscape,logifloaded") == 0) {
+ for (int j = 0; j < argc; j++) {
+ if (strcasecmp(argn[j], "log") == 0) {
+ int length = 26 + strlen(argv[j]) + 1;
+ char* buffer = (char*) malloc(length);
+ snprintf(buffer, length, "xWebkitTestNetscapeLog('%s')", argv[j]);
+ executeScript(obj, buffer);
+ free(buffer);
+ }
+ }
+ } else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
obj->_onSetWindow_ = strdup(argv[i]);
else if (strcasecmp(argn[i], "onNew") == 0 && !onNewScript)
_onNewScript_ = argv[i];