gecko-dev/dom/cache/test/xpcshell/test_schema_26_upgrade.js
Tom Tung d06f3586f2 Bug 1398043 - P3: Add a test to verify (DOM) Cache upgrade successfully. r=bkelly
MozReview-Commit-ID: IYyvEe3r0g4

--HG--
extra : rebase_source : e6430a0cb66bfed5d07b069c923793ef423e4e43
2017-09-08 19:22:18 +08:00

22 lines
723 B
JavaScript

/**
* The schema_25_profile.zip are made from local Nightly by following step
* 1. Go to any website
* 2. Open web console and type
* caches.open("test")
* .then(c => fetch("https://www.mozilla.org", {mode:"no-cors"})
* .then(r => c.put("https://www.mozilla.org", r)));
* 3. Go to profile directory and rename the website folder to "chrome"
*/
async function run_test() {
do_test_pending();
create_test_profile('schema_25_profile.zip');
let cache = await caches.open("test");
let response = await cache.match("https://www.mozilla.org");
ok(!!response, "Upgrade from 25 to 26 do succeed");
ok(response.type === 'opaque', "The response type does be opaque");
do_test_finished();
}