~phablet-team/webbrowser-app/15.04

« back to all changes in this revision

Viewing changes to tests/unittests/qml/tst_UbuntuWebView01.qml

  • Committer: CI Train Bot
  • Author(s): Alexandre Abreu
  • Date: 2015-04-10 13:33:10 UTC
  • mfrom: (955.3.2 remove-qtwebkit)
  • Revision ID: ci-train-bot@canonical.com-20150410133310-x2mbbmfuml090wqh
remove qtwebkit deps (LP: #1362640) Fixes: #1362640
Approved by: Timo Jyrinki, PS Jenkins bot, Olivier Tilloy

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2013 Canonical Ltd.
3
 
 *
4
 
 * This file is part of webbrowser-app.
5
 
 *
6
 
 * webbrowser-app is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; version 3.
9
 
 *
10
 
 * webbrowser-app is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 */
18
 
 
19
 
import QtQuick 2.0
20
 
import QtTest 1.0
21
 
import Ubuntu.Components.Extras.Browser 0.1
22
 
 
23
 
TestCase {
24
 
    name: "UbuntuWebView"
25
 
 
26
 
    function test_custom_UA_override() {
27
 
        compare(webview1.getUAString(), undefined)
28
 
        // passing a 'url' parameter to getUAString()
29
 
        // (as was the API before) shouldn’t hurt:
30
 
        compare(webview1.getUAString("http://example.com"), undefined)
31
 
        verify(webview1.experimental.userAgent !== undefined)
32
 
        compare(webview2.experimental.userAgent, "custom UA")
33
 
    }
34
 
 
35
 
    UbuntuWebView {
36
 
        id: webview1
37
 
    }
38
 
 
39
 
    UbuntuWebView {
40
 
        id: webview2
41
 
 
42
 
        function getUAString(url) {
43
 
            return "custom UA"
44
 
        }
45
 
    }
46
 
}