function testDeclarativeWebRequestAPI() {
  var step = 1;
  var webview = new WebView();
  var rule = {
    conditions: [
      new chrome.webViewRequest.RequestMatcher(
        {
          url: { urlContains: 'guest' }
        }
      )
    ],
    actions: [
      new chrome.webViewRequest.CancelRequest()
    ]
  };
  webview.request.onRequest.addRules([rule]);
  webview.addEventListener('loadabort', function(e) {
    embedder.test.assertEq(1, step);
    embedder.test.assertEq('ERR_BLOCKED_BY_CLIENT', e.reason);
    step = 2;
    webview.request.onRequest.removeRules();
    webview.reload();
  });
  webview.addEventListener('loadstop', function(e) {
    embedder.test.assertEq(2, step);
    embedder.test.succeed();
  });
  webview.src = embedder.emptyGuestURL;
  document.body.appendChild(webview);
}
// 5. The page loads successfully.
5. The page loads successfully.
5 . The page loads successfully .
function testDeclarativeWebRequestAPI() {
  var step = 1;
  var webview = new WebView();
  var rule = {
    conditions: [
      new chrome.webViewRequest.RequestMatcher(
        {
          url: { urlContains: 'guest' }
        }
      )
    ],
    actions: [
      new chrome.webViewRequest.CancelRequest()
    ]
  };
  webview.request.onRequest.addRules([rule]);
  webview.addEventListener('loadabort', function(e) {
    embedder.test.assertEq(1, step);
    embedder.test.assertEq('ERR_BLOCKED_BY_CLIENT', e.reason);
    step = 2;
    webview.request.onRequest.removeRules();
    webview.reload();
  });
  webview.addEventListener('loadstop', function(e) {
    embedder.test.assertEq(2, step);
    embedder.test.succeed();
  });
  webview.src = embedder.emptyGuestURL;
  document.body.appendChild(webview);
}
function testDeclarativeWebRequestAPI ( ) { var step = 1 ; var webview = new WebView ( ) ; var rule = { conditions : [ new chrome . webViewRequest . RequestMatcher ( { url : { urlContains : 'guest' } } ) ] , actions : [ new chrome . webViewRequest . CancelRequest ( ) ] } ; webview . request . onRequest . addRules ( [ rule ] ) ; webview . addEventListener ( 'loadabort' , function ( e ) { embedder . test . assertEq ( 1 , step ) ; embedder . test . assertEq ( 'ERR_BLOCKED_BY_CLIENT' , e . reason ) ; step = 2 ; webview . request . onRequest . removeRules ( ) ; webview . reload ( ) ; } ) ; webview . addEventListener ( 'loadstop' , function ( e ) { embedder . test . assertEq ( 2 , step ) ; embedder . test . succeed ( ) ; } ) ; webview . src = embedder . emptyGuestURL ; document . body . appendChild ( webview ) ; }
5.
5 .