~osomon/oxide/power-save-blocker

« back to all changes in this revision

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

  • Committer: Chris Coulson
  • Date: 2014-06-02 15:06:30 UTC
  • Revision ID: chris.coulson@canonical.com-20140602150630-pahmaxtqonhxvmuc
Stop using WebContents::SetUserAgentOverride to set the user agent string, as this is unreliable in some circumstances. Instead, have a child-process-global user agent string

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
  TestCase {
35
35
    id: test
36
 
    name: "bugXXXXXXX"
 
36
    name: "bug1324909"
37
37
    when: windowShown
38
38
 
39
 
    function test_bugXXXXXXX() {
 
39
    function test_bug1324909_1_new_window() {
40
40
      verify(webView.context.userAgent != "Foo");
41
41
      webView.context.userAgent = "Foo";
42
42
 
49
49
      spy.wait();
50
50
      verify(created != null);
51
51
 
52
 
      skip(created.getTestApi().evaluateCode(
 
52
      compare(created.getTestApi().evaluateCode(
 
53
          "return document.getElementById(\"useragent\").innerHTML;", true),
 
54
          "Foo");
 
55
    }
 
56
 
 
57
    function test_bug1324909_2_subframe() {
 
58
      webView.url = "http://localhost:8080/tst_bug1324909_2.html";
 
59
      verify(webView.waitForLoadSucceeded());
 
60
 
 
61
      console.log(webView.getTestApiForFrame(webView.rootFrame.childFrames[0]).documentURI);
 
62
      compare(webView.getTestApiForFrame(webView.rootFrame.childFrames[0]).evaluateCode(
53
63
          "return document.getElementById(\"useragent\").innerHTML;", true),
54
64
          "Foo");
55
65
    }