B2G/gecko/dom/browser-element/mochitest/browserElement_BadScreenshot.js
// getScreenshot() to throw an exception.
getScreenshot() to throw an exception.
getScreenshot () to throw an exception .
function checkScreenshotResult(expectSuccess, args) {
  var req;
  try {
    req = iframe.getScreenshot.apply(iframe, args);
  }
  catch(e) {
    ok(!expectSuccess, "getScreenshot(" + JSON.stringify(args) + ") threw an exception.");
    return;
  }
  numPendingTests++;
  req.onsuccess = function() {
    ok(expectSuccess, "getScreenshot(" + JSON.stringify(args) + ") succeeded.");
    numPendingTests--;
    if (numPendingTests == 0) {
      SimpleTest.finish();
    }
  };
  req.onerror = function() {
    ok(false, "getScreenshot(" + JSON.stringify(args) + ") ran onerror.");
    numPendingTests--;
    if (numPendingTests == 0) {
      SimpleTest.finish();
    }
  };
}
function checkScreenshotResult ( expectSuccess , args ) { var req ; try { req = iframe . getScreenshot . apply ( iframe , args ) ; } catch ( e ) { ok ( ! expectSuccess , "getScreenshot(" + JSON . stringify ( args ) + ") threw an exception." ) ; return ; } numPendingTests ++ ; req . onsuccess = function ( ) { ok ( expectSuccess , "getScreenshot(" + JSON . stringify ( args ) + ") succeeded." ) ; numPendingTests -- ; if ( numPendingTests == 0 ) { SimpleTest . finish ( ) ; } } ; req . onerror = function ( ) { ok ( false , "getScreenshot(" + JSON . stringify ( args ) + ") ran onerror." ) ; numPendingTests -- ; if ( numPendingTests == 0 ) { SimpleTest . finish ( ) ; } } ; }
getScreenshot() to throw an exception.
getScreenshot () to throw an exception .
// We never expect to see onerror.