test_minimizeMemory.js (641B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 // This file tests that invoking `Service::minimizeMemory` succeeds for sync 5 // and async connections. 6 7 function minimizeMemory() { 8 Services.storage 9 .QueryInterface(Ci.nsIObserver) 10 .observe(null, "memory-pressure", null); 11 } 12 13 add_task(async function test_minimizeMemory_async_connection() { 14 let db = await openAsyncDatabase(getTestDB()); 15 minimizeMemory(); 16 await asyncClose(db); 17 }); 18 19 add_task(async function test_minimizeMemory_sync_connection() { 20 let db = getOpenedDatabase(); 21 minimizeMemory(); 22 db.close(); 23 });