~abreu-alexandre/oxide/add-ua-to-downloadrequested

« back to all changes in this revision

Viewing changes to qt/tests/qmltests/api/tst_GeolocationPermissionRequest.qml

  • Committer: Chris Coulson
  • Date: 2014-09-01 13:49:18 UTC
  • mfrom: (694.1.23 ssl-status-api)
  • Revision ID: chris.coulson@canonical.com-20140901134918-3mqi09aln7uldf2l
Add WebView.securityStatus, WebView.blockedContent, WebView.setCanTemporarilyDisplayInsecureContent, WebView.setCanTemporarilyRunInsecureContent, SecurityStatus, CertificateError and SslCertificate API's. I'm still working on tests for these API's, but this shouldn't block webbrowser-app work

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
      ];
57
57
    }
58
58
 
 
59
    SignalSpy {
 
60
      id: spy
 
61
      signalName: "cancelled"
 
62
    }
 
63
 
59
64
    function test_GeolocationPermissionRequest1(data) {
60
65
      webView.url = "http://localhost:8080/tst_GeolocationPermissionRequest.html";
61
66
      verify(webView.waitForLoadSucceeded(),
81
86
             "Timed out waiting for geolocation response");
82
87
      compare(webView.lastGeolocationStatus, data.expected);
83
88
    }
 
89
 
 
90
    function test_GeolocationPermissionRequest2_cancel() {
 
91
      webView.url = "http://localhost:8080/tst_GeolocationPermissionRequest.html";
 
92
      verify(webView.waitForLoadSucceeded(),
 
93
             "Timed out waiting for successful load");
 
94
 
 
95
      var r = webView.getTestApi().getBoundingClientRectForSelector("#button");
 
96
      mouseClick(webView, r.x + r.width / 2, r.y + r.height / 2, Qt.LeftButton);
 
97
 
 
98
      verify(webView.waitFor(function() { return !!webView.lastGeolocationRequest; }),
 
99
             "Timed out waiting for geolocation request");
 
100
 
 
101
      spy.target = webView.lastGeolocationRequest;
 
102
 
 
103
      webView.getTestApi().evaluateCode(
 
104
          "window.location = \"http://localhost:8080/empty.html\";", false);
 
105
 
 
106
      spy.wait();
 
107
      compare(spy.count, 1) << "Pending request should have been cancelled";
 
108
    }
84
109
  }
85
110
}