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

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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/plugins/ppapi/message_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 '<span class="fail">FAIL</span>: ' + 152 '<span class="fail">FAIL</span>: ' +
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.addEventListener("message", handleTestingMessage, true); 161 container.addEventListener("message", handleTestingMessage, true);
162 // Register a bad dispatchEvent to make sure it isn't used. See 'EVIL' note
163 // below.
164 obj.dispatchEvent = function() {
165 LogHTML("<p>Bad dispatchEvent called!");
166 }
162 container.appendChild(obj); 167 container.appendChild(obj);
163 } 168 }
164 } 169 }
170
171 // EVIL Note:
172 // This part of the script does some nefarious things to make sure that it
173 // doesn't affect the behavior of PostMessage (on which all the tests rely). In
174 // particular, we replace document.createEvent, MessageEvent.initMessageEvent,
175 // and the MessageEvent constructor. Previous versions of the PostMessage
176 // implementation made use of these and would fail (http://crbug.com/82604).
177 document.createEvent = function() {
178 LogHTML("<p>Bad document.createEvent called!");
179 }
180 function MessageEvent() {
181 LogHTML("<p>Bad MessageEvent constructor called!");
182 }
183 MessageEvent.prototype.initMessageEvent = function() {
184 LogHTML("<p>Bad MessageEvent.initMessageEvent called!");
185 }
186
165 </script> 187 </script>
166 </head><body> 188 </head><body>
167 <div> 189 <div>
168 <div id="container"></div> 190 <div id="container"></div>
169 <div id="console" /><span class="load_msg">loading...</span></div> 191 <div id="console" /><span class="load_msg">loading...</span></div>
170 </div> 192 </div>
171 </body></html> 193 </body></html>
OLDNEW
« 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