Disable web page and object memory cache
Pages and assets should not be retrieved from the cache. This leads to unexpected results in testing. Also, the raw content of cached objects and pages cannot be retrieved.
This commit is contained in:
parent
70ffd66213
commit
39c37a67e4
|
@ -2070,6 +2070,24 @@ describe Capybara::Webkit::Driver do
|
|||
end
|
||||
end
|
||||
|
||||
context "caching app" do
|
||||
let(:driver) do
|
||||
etag_value = SecureRandom.hex
|
||||
|
||||
driver_for_app do
|
||||
get '/' do
|
||||
etag etag_value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it "does not cache responses" do
|
||||
visit '/'
|
||||
visit '/'
|
||||
expect(driver.status_code).to eq(200)
|
||||
end
|
||||
end
|
||||
|
||||
context "offline application cache" do
|
||||
let(:driver) do
|
||||
@visited = []
|
||||
|
|
|
@ -29,6 +29,10 @@ WebPageManager::WebPageManager(QObject *parent) : QObject(parent) {
|
|||
m_networkAccessManager =
|
||||
new NetworkAccessManager(m_blacklistedRequestHandler, this);
|
||||
m_networkAccessManager->setCookieJar(m_cookieJar);
|
||||
|
||||
QWebSettings::setMaximumPagesInCache(0);
|
||||
QWebSettings::setObjectCacheCapacities(0, 0, 0);
|
||||
|
||||
createPage()->setFocus();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue