title: Protractor times out waiting for sync with page when using $resource
body: <p>I'm testing Protractor with a small AngularJS app.</p>
  
  <p>This is the test:</p>
  
  <pre><code>describe('Testing Protractor', function() {
    var draftList;
  
    it('should count the number of drafts', function() {
      browser.get('#/');
      draftList = element.all(by.repeater('newsletter in drafts'));
      expect(draftList.count()).toEqual(2);
    });
  });
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>angular.module('myApp.controllers', []).
    controller('DraftsCtrl', ['$scope', 'Draft', function($scope, Draft) {
      $scope.drafts = Draft.query();
  }])
  </code></pre>
  
  <p>Draft service:</p>
  
  <pre><code>angular.module('myApp.services', ['ngResource']).
    factory('Draft', ['$resource',
      function($resource) {
        return $resource('api/drafts/:id')
      }])
  </code></pre>
  
  <p>Running this test using Protractor results in the following error:</p>
  
  <pre><code>Error: Timed out waiting for Protractor to synchronize with the page after 11 seconds
  </code></pre>
  
  <p>However, if in the controller I change this line:</p>
  
  <pre><code>$scope.drafts = Draft.query();
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>$scope.drafts = [];
  </code></pre>
  
  <p>The test fails as expected, but more importantly: it does not time out.</p>
  
  <p>With query() enabled, both when running the app manually in a browser and when looking at the browser window opened by Protractor, the data returned by the API is correctly displayed by a repeater.</p>
  
  <p>Why is Protractor not able to synchronize with the page when the service is communicating with the API?</p>
  
  <p>AngularJS is v1.2.0-rc3. Protractor is v0.12.0.</p>