run.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. header( "Content-type: text/html; charset=utf-8" );
  3. header( "Cache-Control: no-cache, max-age=10, must-revalidate" );
  4. if ( !array_key_exists( 'quirk' , $_GET ) ) {
  5. print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
  6. }
  7. ;
  8. require_once "case.class.php";
  9. $c = new Kiss( '../../../' , $_GET[ 'case' ] );
  10. $title = $c->name;
  11. $cov = array_key_exists( 'cov' , $_GET );
  12. ?>
  13. <html>
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  16. <title><?php print( "run case $title" );?></title>
  17. <?php $c->print_js( $cov ); ?>
  18. </head>
  19. <body>
  20. <h1 id="qunit-header"><?php print( $c->name );?></h1>
  21. <h2 id="qunit-banner"></h2>
  22. <h2 id="qunit-userAgent"></h2>
  23. <ol id="qunit-tests"></ol>
  24. <script type="text/javascript">
  25. /**捕获所有页面的异常,当有异常时如果是关于用例执行完毕还有对editor的调用这种情况,一律忽略,其他照常抛异常**/
  26. window.onerror = function( e ) {
  27. msg1 = "Uncaught TypeError: Cannot call method 'select' of null";
  28. msg2 = "Uncaught TypeError: Cannot call method 'getSelection' of undefined";
  29. msg3 = "'sourceEditor' 为空或不是对象";
  30. msg4 = "未指明的错误。";
  31. if ( e != msg1 && e != msg2 && e.indexOf( msg3 ) < 0 && e != msg4 ) {
  32. // throw new Error( e );
  33. } else {
  34. return true;
  35. }
  36. };
  37. </script>
  38. <div>
  39. <object id="plugin" type="application/x-plugintest" width="1" height="1">
  40. <param name="onload" value="pluginLoaded"/>
  41. </object>
  42. </div>
  43. </body>
  44. </html>