~abreu-alexandre/oxide/donottrack

« back to all changes in this revision

Viewing changes to qt/tests/qmltests/core/tst_bug1234555.qml

  • Committer: Chris Coulson
  • Date: 2015-06-24 23:53:39 UTC
  • Revision ID: chris.coulson@canonical.com-20150624235339-vam4wg6wh3adzf0z
Improve script messaging tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
TestWebView {
7
7
  id: webView
8
 
  focus: true
9
8
  width: 200
10
9
  height: 200
11
10
 
 
11
  Component.onCompleted: {
 
12
    ScriptMessageTestUtils.init(webView.context);
 
13
  }
 
14
 
12
15
  TestCase {
13
16
    id: test
14
17
    name: "bug1234555"
24
27
 
25
28
      function sendMessage(frame) {
26
29
        numberSent++;
27
 
        var req = frame.sendMessage("oxide://testutils/", "DONT-RESPOND", {});
 
30
        var req = frame.sendMessageNoWait("TEST-DONT-RESPOND");
28
31
        req.onerror = function(code, msg) {
29
32
          errorsReceived.push({code: code, msg: msg});
30
33
        };
32
35
 
33
36
      // FIXME(chrisccoulson): Doesn't work for top-level navigations
34
37
      //  see https://launchpad.net/bugs/1287581
35
 
      //sendMessage(webView.rootFrame);
36
 
      sendMessage(webView.rootFrame.childFrames[0]);
 
38
      //sendMessage(new ScriptMessageTestUtils.FrameHelper(webView.rootFrame));
 
39
      sendMessage(new ScriptMessageTestUtils.FrameHelper(webView.rootFrame.childFrames[0]));
37
40
 
38
41
      webView.url = "about:blank";
39
42
      verify(webView.waitForLoadSucceeded(),