summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2013-09-05 17:44:37 -0700
committerPhilip Chimento <philip@endlessm.com>2013-09-16 10:30:42 -0700
commit02f3b14035f0b7f97f24c6bb2f8e81ee1884bc0c (patch)
tree5cf37385795d237ee19e01765af03af878a7bb53 /test
parentd88e6674fd6fcad3bdd841c75c81fec1815615c8 (diff)
Move webhelper smoke test into a new subdir
The webhelper tests should be in their own directory, mirroring the source directory structure. [endlessm/eos-sdk#290]
Diffstat (limited to 'test')
-rw-r--r--test/smoke-tests/webview/first_page.html54
-rw-r--r--test/webhelper/smoke-tests/webview.js (renamed from test/smoke-tests/webview.js)55
2 files changed, 49 insertions, 60 deletions
diff --git a/test/smoke-tests/webview/first_page.html b/test/smoke-tests/webview/first_page.html
deleted file mode 100644
index 33a6a8f..0000000
--- a/test/smoke-tests/webview/first_page.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<html>
-
-<head>
-<title>First page</title>
-
-<style>
-p, form {
- width: 50%;
- padding: 1em;
- background: #FFFFFF;
-}
-
-body {
- background: #EEEEEE;
-}
-</style>
-</head>
-
-<body>
-
-<h1>First page</h1>
-
-<p>
-<a href="endless://moveToPage?name=page2">Move to page 2</a>
-</p>
-
-<p>
-<a href="endless://showMessageFromParameter?msg=This%20is%20a%20message%20from%20the%20URL%20parameter">Show message from parameter in this URL</a>
-</p>
-
-<form action="endless://showMessageFromParameter">
-<input name="msg" value="I am in a form!"/>
-<input type="submit" value="Show message using a form"/>
-</form>
-
-<p>
-<input id="inputformessage" value="my ID is inputformessage"/>
-<a href="endless://showMessageFromInputField?id=inputformessage">Show message using the &lt;input&gt;'s ID</a>
-</p>
-
-<p>
-<a href="http://wikipedia.org">Regular link to a Web site</a>
-</p>
-
-<p>
-<a href="endless://addStars?id=starspan">I want stars!</a> <span id="starspan" />
-</p>
-
-<p>
-This is text that will be translated: <span name="translatable">Hello, world!</span>
-</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/test/smoke-tests/webview.js b/test/webhelper/smoke-tests/webview.js
index 98226f3..681de20 100644
--- a/test/smoke-tests/webview.js
+++ b/test/webhelper/smoke-tests/webview.js
@@ -11,6 +11,53 @@ const WebHelper = imports.webhelper;
const TEST_APPLICATION_ID = 'com.endlessm.example.test-webview';
+const TEST_HTML = '\
+<html> \
+<head> \
+<title>First page</title> \
+<style> \
+p, form { \
+ width: 50%; \
+ padding: 1em; \
+ background: #FFFFFF; \
+} \
+body { \
+ background: #EEEEEE; \
+} \
+</style> \
+</head> \
+\
+<body> \
+<h1>First page</h1> \
+\
+<p><a href="endless://moveToPage?name=page2">Move to page 2</a></p> \
+\
+<p><a \
+href="endless://showMessageFromParameter?msg=This%20is%20a%20message%20from%20the%20URL%20parameter">Show \
+message from parameter in this URL</a></p> \
+\
+<form action="endless://showMessageFromParameter"> \
+<input name="msg" value="I am in a form!"/> \
+<input type="submit" value="Show message using a form"/> \
+</form> \
+\
+<p> \
+<input id="inputformessage" value="my ID is inputformessage"/> \
+<a href="endless://showMessageFromInputField?id=inputformessage">Show message \
+using the &lt;input&gt;\'s ID</a> \
+</p> \
+\
+<p><a href="http://wikipedia.org">Regular link to a Web site</a></p> \
+\
+<p><a href="endless://addStars?id=starspan">I want \
+stars!</a> <span id="starspan"/></p> \
+\
+<p>This is text that will be translated: <span name="translatable">Hello, \
+world!</span></p> \
+\
+</body> \
+</html>';
+
const TestApplication = new Lang.Class({
Name: 'TestApplication',
Extends: WebHelper.Application,
@@ -64,12 +111,8 @@ const TestApplication = new Lang.Class({
this.parent();
this._webview = new WebKit.WebView();
-
- let cwd = GLib.get_current_dir();
- let target = cwd + '/test/smoke-tests/webview/first_page.html';
- this._webview.load_uri(GLib.filename_to_uri(target, null));
-
- this._webview.connect('notify::load-status',
+ this._webview.load_string(TEST_HTML, 'text/html', 'UTF-8', 'file://');
+ this._webview.connect('notify::load-status',
Lang.bind(this, function (web_view, status) {
if (web_view.load_status == WebKit.LoadStatus.FINISHED) {
// now we translate to Brazilian Portuguese