summaryrefslogtreecommitdiff
path: root/tests/qml/receiveRaw.html
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2013-11-06 16:47:48 +0100
committerMilian Wolff <milian.wolff@kdab.com>2013-11-14 16:41:27 +0100
commitbc06e88886ca33ce68c3ae3a72cf011257d1fadd (patch)
tree64716a51c4da5f73425f965475e5057a1c2345bc /tests/qml/receiveRaw.html
parent86eacb18b6868173b63b8f67feb481d6e291ad7a (diff)
downloadqtwebchannel-bc06e88886ca33ce68c3ae3a72cf011257d1fadd.tar.gz
Add unit test harness for QWebChannel and two initial tests.
This uncovered a bug in webchannel.js, which stringified strings leading to duplicated quoting. This is also fixed now. Furthermore, some QMake changes are required to make it possible to run the tests without first installing QWebChannel. Change-Id: If7e8f73a748f86f2d5c7d39000e90612367038af Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'tests/qml/receiveRaw.html')
-rw-r--r--tests/qml/receiveRaw.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/qml/receiveRaw.html b/tests/qml/receiveRaw.html
new file mode 100644
index 0000000..cfe685e
--- /dev/null
+++ b/tests/qml/receiveRaw.html
@@ -0,0 +1,15 @@
+<html>
+ <head>
+ <script type="text/javascript" src="qrc:///qwebchannel/webchannel.js"></script>
+ <script type="text/javascript">
+ //BEGIN SETUP
+ var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ new QWebChannel(baseUrl, function(channel) {
+ channel.send("foobar");
+ });
+ //END SETUP
+ </script>
+ </head>
+ <body>
+ </body>
+</html>