title: Protractor closing current tab
body: <p>I have a non-angular page where I need to click on 2 links. When clicking on one of the link that automatically opens in a new tab. Now I switch to new tab and set the <code>browser.ignoreSynchronization = false</code> because the newly opened tab is a angular window; and call one of my test. Once verified. I want to close the current tab and go back to the non-angular page to click on link #2 which would again open in a new tab. I tried <code>window.close</code> but i am getting window is undefined. I used browser.window and even that is not working. Please advise</p>
  
  <pre><code>element(by.id('trMyUrl'));
      browser.getAllWindowHandles().then(function (handles) {
               var secondWindowHandle = handles[1];
               var firstWindowHandle = handles[0];
      browser.switchTo().window(secondWindowHandle).then(function () { //the focus moves on new tab\
      browser.ignoreSynchronization = false;    
      empLogin.test();
      window(secondWindowHandle).close()
      // window.close()
      // browser.close()
      // browser.window.close()
  
       })
  });
  </code></pre>