function testLoadAbortNonWebSafeScheme() {
  var webview = document.createElement('webview');
  var chromeGuestURL = 'chrome-guest://abc123/';
  webview.addEventListener('loadabort', function(e) {
    embedder.test.assertEq(-301, e.code);
    embedder.test.assertEq('ERR_DISALLOWED_URL_SCHEME', e.reason);
    embedder.test.assertEq(chromeGuestURL, e.url);
  });
  webview.addEventListener('loadstop', function(e) {
    embedder.test.assertEq('about:blank', webview.src);
    embedder.test.succeed();
  });
  webview.addEventListener('exit', function(e) {
    // We should not crash.
    embedder.test.fail();
  });
  webview.src = chromeGuestURL;
  document.body.appendChild(webview);
}
// pseudo-scheme fires loadabort and doesn't cause a crash.
pseudo-scheme fires loadabort and doesn't cause a crash.
pseudo - scheme fires loadabort and doesn ' t cause a crash .
function testLoadAbortNonWebSafeScheme() {
  var webview = document.createElement('webview');
  var chromeGuestURL = 'chrome-guest://abc123/';
  webview.addEventListener('loadabort', function(e) {
    embedder.test.assertEq(-301, e.code);
    embedder.test.assertEq('ERR_DISALLOWED_URL_SCHEME', e.reason);
    embedder.test.assertEq(chromeGuestURL, e.url);
  });
  webview.addEventListener('loadstop', function(e) {
    embedder.test.assertEq('about:blank', webview.src);
    embedder.test.succeed();
  });
  webview.addEventListener('exit', function(e) {
    embedder.test.fail();
  });
  webview.src = chromeGuestURL;
  document.body.appendChild(webview);
}
function testLoadAbortNonWebSafeScheme ( ) { var webview = document . createElement ( 'webview' ) ; var chromeGuestURL = 'chrome-guest://abc123/' ; webview . addEventListener ( 'loadabort' , function ( e ) { embedder . test . assertEq ( - 301 , e . code ) ; embedder . test . assertEq ( 'ERR_DISALLOWED_URL_SCHEME' , e . reason ) ; embedder . test . assertEq ( chromeGuestURL , e . url ) ; } ) ; webview . addEventListener ( 'loadstop' , function ( e ) { embedder . test . assertEq ( 'about:blank' , webview . src ) ; embedder . test . succeed ( ) ; } ) ; webview . addEventListener ( 'exit' , function ( e ) { embedder . test . fail ( ) ; } ) ; webview . src = chromeGuestURL ; document . body . appendChild ( webview ) ; }
pseudo-scheme fires loadabort and doesn't cause a crash.
pseudo - scheme fires loadabort and doesn ' t cause a crash .
// We should not crash.