| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script> | |
| 5 addEventListener('load', startTest, false); | |
| 6 var noReturnValueFunctionCalled = false; | |
| 7 var returnValueFunctionCalled = false; | |
| 8 var noReturnValueReason = -1; | |
| 9 var returnValueReason = -1; | |
| 10 | |
| 11 function startTest() { | |
| 12 if (window.testRunner) { | |
| 13 testRunner.dumpAsText(); | |
| 14 testRunner.waitUntilDone(); | |
| 15 } | |
| 16 | |
| 17 var plugin = document.getElementsByTagName('embed')[0]; | |
| 18 plugin.getURLNotify('javascript:noReturnValueFunction()', '_self', '
noReturnValueURLNotify'); | |
| 19 plugin.getURLNotify('javascript:returnValueFunction()', '_self', 're
turnValueURLNotify'); | |
| 20 | |
| 21 // The javascript: URLs will be evaluated asynchronously. Since we d
on't expect a | |
| 22 // callback when the evaluation is complete, we have to use a lame t
imeout to give | |
| 23 // the callback time to be evaluated. | |
| 24 setTimeout(finishTest, 250); | |
| 25 } | |
| 26 | |
| 27 function finishTest() { | |
| 28 if (!noReturnValueFunctionCalled) | |
| 29 log('FAIL: noReturnValueFunction was not called'); | |
| 30 else if (noReturnValueReason !== -1 && noReturnValueReason !== 0) | |
| 31 log('FAIL (no return value): NPP_URLNotify called with unexpecte
d reason ' + noReturnValueReason); | |
| 32 else | |
| 33 log('SUCCESS (no return value): NPP_URLNotify was not called, or
was called with a reason of NPRES_DONE'); | |
| 34 | |
| 35 if (!returnValueFunctionCalled) | |
| 36 log('FAIL: returnValueFunction was not called'); | |
| 37 else if (returnValueReason !== -1 && returnValueReason !== 0) | |
| 38 log('FAIL (return value): NPP_URLNotify called with unexpected r
eason ' + returnValueReason); | |
| 39 else | |
| 40 log('SUCCESS (return value): NPP_URLNotify was not called, or wa
s called with a reason of NPRES_DONE'); | |
| 41 | |
| 42 if (window.testRunner) | |
| 43 testRunner.notifyDone(); | |
| 44 } | |
| 45 | |
| 46 function log(msg) { | |
| 47 document.getElementById('log').appendChild(document.createTextNode(m
sg + '\n')); | |
| 48 } | |
| 49 | |
| 50 function noReturnValueFunction() { | |
| 51 noReturnValueFunctionCalled = true; | |
| 52 } | |
| 53 | |
| 54 function returnValueFunction() { | |
| 55 returnValueFunctionCalled = true; | |
| 56 return 'foo'; | |
| 57 } | |
| 58 | |
| 59 function noReturnValueURLNotify(reason) { | |
| 60 noReturnValueReason = reason; | |
| 61 } | |
| 62 | |
| 63 function returnValueURLNotify(reason) { | |
| 64 returnValueReason = reason; | |
| 65 } | |
| 66 </script> | |
| 67 </head> | |
| 68 <body> | |
| 69 <embed type="application/x-webkit-test-netscape"></embed> | |
| 70 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=60568">Bug 6056
8: REGRESSION (WebKit2): Flash plugin doesn't appear on a hanes.com page</a>.</p
> | |
| 71 <pre id="log"></pre> | |
| 72 </body> | |
| 73 </html> | |
| OLD | NEW |