From e20c3909e52df91a3ffbb7c3e19e4f1765248e09 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 16 Feb 2018 12:09:56 +0100 Subject: [PATCH] WebTabTest: Add saveNotRestoredTabTest --- autotests/webtabtest.cpp | 16 ++++++++++++++++ autotests/webtabtest.h | 1 + 2 files changed, 17 insertions(+) diff --git a/autotests/webtabtest.cpp b/autotests/webtabtest.cpp index 63dc1b083..cdbd67acc 100644 --- a/autotests/webtabtest.cpp +++ b/autotests/webtabtest.cpp @@ -273,4 +273,20 @@ void WebTabTest::loadNotRestoredTabTest() QCOMPARE(tab.webView()->history()->backItem().url(), QUrl("qrc:autotests/data/basic_page.html")); } +void WebTabTest::saveNotRestoredTabTest() +{ + WebTab tab; + + tab.load(QUrl("qrc:autotests/data/basic_page.html")); + QVERIFY(waitForLoadfinished(&tab)); + QTRY_COMPARE(tab.webView()->history()->count(), 1); + + tab.unload(); + QVERIFY(!tab.isRestored()); + + WebTab::SavedTab saved(&tab); + QVERIFY(saved.isValid()); + QCOMPARE(saved.url, QUrl("qrc:autotests/data/basic_page.html")); +} + FALKONTEST_MAIN(WebTabTest) diff --git a/autotests/webtabtest.h b/autotests/webtabtest.h index 721945439..f63ec600d 100644 --- a/autotests/webtabtest.h +++ b/autotests/webtabtest.h @@ -32,4 +32,5 @@ private slots: void prependChildTabsTest(); void moveTabTest(); void loadNotRestoredTabTest(); + void saveNotRestoredTabTest(); };