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

Side by Side 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: Add nefarious code to test_case.html to test the change. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html><head> 1 <html><head>
2 <meta http-equiv="Pragma" content="no-cache" /> 2 <meta http-equiv="Pragma" content="no-cache" />
3 <meta http-equiv="Expires" content="-1" /> 3 <meta http-equiv="Expires" content="-1" />
4 <link rel="stylesheet" href="test_page.css"> 4 <link rel="stylesheet" href="test_page.css">
5 <script> 5 <script>
6 function AdjustHeight(frameWin) { 6 function AdjustHeight(frameWin) {
7 var div = frameWin.document.getElementsByTagName("div")[0]; 7 var div = frameWin.document.getElementsByTagName("div")[0];
8 var height = frameWin.getComputedStyle(div).height; 8 var height = frameWin.getComputedStyle(div).height;
9 frameWin.frameElement.style.height = height; 9 frameWin.frameElement.style.height = height;
10 } 10 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 '<span class="err_msg">Test plug-in is not registered.</span>'; 153 '<span class="err_msg">Test plug-in is not registered.</span>';
154 } 154 }
155 } 155 }
156 if (obj) { 156 if (obj) {
157 obj.setAttribute("id", "plugin"); 157 obj.setAttribute("id", "plugin");
158 obj.setAttribute("testcase", testcase); 158 obj.setAttribute("testcase", testcase);
159 obj.setAttribute("protocol", window.location.protocol); 159 obj.setAttribute("protocol", window.location.protocol);
160 var container = document.getElementById("container"); 160 var container = document.getElementById("container");
161 container.appendChild(obj); 161 container.appendChild(obj);
162 container.addEventListener("message", handleTestingMessage, true); 162 container.addEventListener("message", handleTestingMessage, true);
163
164 // Register a bad dispatchEvent to make sure it isn't used. See 'EVIL' note
165 // below.
166 obj.dispatchEvent = function() {
167 LogHTML("<p>Bad dispatchEvent called!");
168 }
163 } 169 }
164 } 170 }
171
172 // EVIL Note:
173 // This part of the script does some nefarious things to make sure that it
174 // doesn't affect the behavior of PostMessage (on which all the tests rely). In
175 // particular, we replace document.createEvent, MessageEvent.initMessageEvent,
176 // and the MessageEvent constructor. Previous versions of the PostMessage
177 // implementation made use of these and would fail (http://crbug.com/82604).
178 document.createEvent = function() {
179 LogHTML("<p>Bad document.createEvent called!");
180 }
181 function MessageEvent() {
182 LogHTML("<p>Bad MessageEvent constructor called!");
183 }
184 MessageEvent.prototype.initMessageEvent = function() {
185 LogHTML("<p>Bad MessageEvent.initMessageEvent called!");
186 }
187
165 </script> 188 </script>
166 </head><body> 189 </head><body>
167 <div> 190 <div>
168 <div id="container"></div> 191 <div id="container"></div>
169 <div id="console" /><span class="load_msg">loading...</span></div> 192 <div id="console" /><span class="load_msg">loading...</span></div>
170 </div> 193 </div>
171 </body></html> 194 </body></html>
OLDNEW
« no previous file with comments | « no previous file | webkit/plugins/ppapi/message_channel.h » ('j') | webkit/plugins/ppapi/message_channel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698