Merge lp:~osomon/oxide/ensure-files-exist into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 774
Proposed branch: lp:~osomon/oxide/ensure-files-exist
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 56 lines (+47/-0)
2 files modified
qt/tests/qmltests/crash/tst_bug1352952.html (+5/-0)
qt/tests/qmltests/crash/tst_bug1352952.qml (+42/-0)
To merge this branch: bzr merge lp:~osomon/oxide/ensure-files-exist
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+236010@code.launchpad.net

Commit message

Add a crash unit test for bug #1352952.

To post a comment you must log in.
Revision history for this message
Chris Coulson (chrisccoulson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'qt/tests/qmltests/crash/tst_bug1352952.html'
2--- qt/tests/qmltests/crash/tst_bug1352952.html 1970-01-01 00:00:00 +0000
3+++ qt/tests/qmltests/crash/tst_bug1352952.html 2014-09-25 17:22:23 +0000
4@@ -0,0 +1,5 @@
5+<html>
6+<body style="margin: 0">
7+ <input type="file" style="height: 100%; width: 100%">
8+</body>
9+</html>
10
11=== added file 'qt/tests/qmltests/crash/tst_bug1352952.qml'
12--- qt/tests/qmltests/crash/tst_bug1352952.qml 1970-01-01 00:00:00 +0000
13+++ qt/tests/qmltests/crash/tst_bug1352952.qml 2014-09-25 17:22:23 +0000
14@@ -0,0 +1,42 @@
15+import QtQuick 2.0
16+import QtTest 1.0
17+import com.canonical.Oxide 1.0
18+import com.canonical.Oxide.Testing 1.0
19+
20+TestWebView {
21+ id: webView
22+ focus: true
23+ width: 200
24+ height: 200
25+
26+ property bool picked: false
27+
28+ filePicker: Item {
29+ Component.onCompleted: model.accept([""])
30+ Component.onDestruction: webView.picked = true
31+ }
32+
33+ TestCase {
34+ name: "bug1352952"
35+ when: windowShown
36+
37+ function test_bug1352952() {
38+ webView.url = "http://testsuite/tst_bug1352952.html";
39+ verify(webView.waitForLoadSucceeded(),
40+ "Timed out waiting for successful load");
41+
42+ mouseClick(webView, webView.width / 2, webView.height / 2);
43+ verify(webView.waitFor(function() { return webView.picked; }),
44+ "Timed out waiting for filepicker to be dismissed");
45+
46+ // Check that the renderer doesn’t crash. If it does,
47+ // it might not be right away, so give it some time.
48+ for (var i = 0; i < 5; ++i) {
49+ webView.waitFor(function() { return false; }, 500);
50+ // Calling into the test API will raise an exception
51+ // if the renderer process has crashed.
52+ webView.getTestApi().documentURI;
53+ }
54+ }
55+ }
56+}

Subscribers

People subscribed via source and target branches