Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10451

InAppBrowser: loadstart event is not triggered on Windows

    XMLWordPrintableJSON

Details

    Description

      The following unit test fails as 'loadstart' callback is not called on Windows. Main reason is that it is called internally when we do open before we attach event handler. But this is what docs recommend and what other people uses. We should make open method async (Windows proxy or inappbrowser.js) so that handler could be added this way

      it("inappbrowser.spec.4 should support loadstart and loadstop events", function (done) {
                  var onLoadStart = jasmine.createSpy('loadstart event callback').and.callFake(function (evt) {
                      verifyEvent(evt, 'loadstart');
                  });
      
                  iabInsance = cordova.InAppBrowser.open(url, '_blank');
                  iabInsance.addEventListener('loadstart', onLoadStart);
                  iabInsance.addEventListener('loadstop', function (evt) {
                      verifyEvent(evt, 'loadstop');
                      expect(onLoadStart).toHaveBeenCalled();
                      done();
                  });
              });
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            sgrebnov Sergey Grebnov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: