=== added file 'qt/tests/qmltests/crash/tst_bug1477760.html' --- qt/tests/qmltests/crash/tst_bug1477760.html 1970-01-01 00:00:00 +0000 +++ qt/tests/qmltests/crash/tst_bug1477760.html 2015-07-28 16:51:32 +0000 @@ -0,0 +1,6 @@ + + +
+
+ + === added file 'qt/tests/qmltests/crash/tst_bug1477760.qml' --- qt/tests/qmltests/crash/tst_bug1477760.qml 1970-01-01 00:00:00 +0000 +++ qt/tests/qmltests/crash/tst_bug1477760.qml 2015-07-28 16:51:32 +0000 @@ -0,0 +1,41 @@ +import QtQuick 2.0 +import QtTest 1.0 +import com.canonical.Oxide 1.0 +import com.canonical.Oxide.Testing 1.0 + +TestWebView { + id: webView + width: 200 + height: 200 + + Component { + id: webViewFactory + TestWebView { + context: webView.context + } + } + + property var created: null + + onNewViewRequested: { + created = webViewFactory.createObject(webView, { request: request }); + } + + TestCase { + id: test + name: "bug1477760" + when: windowShown + + function test_bug1477760() { + webView.url = "http://testsuite/tst_bug1477760.html"; + verify(webView.waitForLoadSucceeded(), + "Timed out waiting for successful load"); + + mouseClick(webView, webView.width / 2, webView.height / 2); + + TestUtils.waitFor(function() { return !!webView.created; }); + verify(webView.created.waitForLoadSucceeded(), + "Timed out waiting for successful load"); + } + } +} === modified file 'shared/browser/oxide_web_view.cc' --- shared/browser/oxide_web_view.cc 2015-07-07 23:18:27 +0000 +++ shared/browser/oxide_web_view.cc 2015-07-28 16:51:32 +0000 @@ -1028,7 +1028,10 @@ content::NavigationEntry* entry = web_contents_->GetController().GetLastCommittedEntry(); - client_->LoadSucceeded(validated_url, entry->GetHttpStatusCode()); + // Some transient about:blank navigations dont have navigation entries. + client_->LoadSucceeded( + validated_url, + entry ? entry->GetHttpStatusCode() : 0); } void WebView::DidFailLoad(content::RenderFrameHost* render_frame_host,