Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: ppapi/tests/test_case.html

Issue 8437093: Make PostMessageToJavaScript use new WebKit API instead of script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more review fix. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/plugins/ppapi/message_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_case.html
diff --git a/ppapi/tests/test_case.html b/ppapi/tests/test_case.html
index e93d748c69e0589290f67a3b0e7ebc66ad97bb5b..43b24a5ad1a648e98b6a06e65f1fe8024d02522b 100644
--- a/ppapi/tests/test_case.html
+++ b/ppapi/tests/test_case.html
@@ -159,9 +159,31 @@ onload = function() {
obj.setAttribute("protocol", window.location.protocol);
var container = document.getElementById("container");
container.addEventListener("message", handleTestingMessage, true);
+ // Register a bad dispatchEvent to make sure it isn't used. See 'EVIL' note
+ // below.
+ obj.dispatchEvent = function() {
+ LogHTML("<p>Bad dispatchEvent called!");
+ }
container.appendChild(obj);
}
}
+
+// EVIL Note:
+// This part of the script does some nefarious things to make sure that it
+// doesn't affect the behavior of PostMessage (on which all the tests rely). In
+// particular, we replace document.createEvent, MessageEvent.initMessageEvent,
+// and the MessageEvent constructor. Previous versions of the PostMessage
+// implementation made use of these and would fail (http://crbug.com/82604).
+document.createEvent = function() {
+ LogHTML("<p>Bad document.createEvent called!");
+}
+function MessageEvent() {
+ LogHTML("<p>Bad MessageEvent constructor called!");
+}
+MessageEvent.prototype.initMessageEvent = function() {
+ LogHTML("<p>Bad MessageEvent.initMessageEvent called!");
+}
+
</script>
</head><body>
<div>
« no previous file with comments | « no previous file | webkit/plugins/ppapi/message_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698