2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2008-08-16 13:27:09 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* General Update Service Tests */
|
|
|
|
|
|
|
|
function run_test() {
|
2010-10-19 21:28:29 -07:00
|
|
|
do_test_pending();
|
|
|
|
do_register_cleanup(end_test);
|
|
|
|
|
2009-04-16 18:32:32 -07:00
|
|
|
// Verify write access to the custom app dir
|
2010-10-19 21:28:29 -07:00
|
|
|
logTestInfo("testing write access to the application directory");
|
2009-09-18 11:03:45 -07:00
|
|
|
removeUpdateDirsAndFiles();
|
2009-04-20 14:08:03 -07:00
|
|
|
var testFile = getCurrentProcessDir();
|
2009-04-16 18:32:32 -07:00
|
|
|
testFile.append("update_write_access_test");
|
|
|
|
testFile.create(AUS_Ci.nsIFile.NORMAL_FILE_TYPE, 0644);
|
|
|
|
do_check_true(testFile.exists());
|
|
|
|
testFile.remove(false);
|
|
|
|
do_check_false(testFile.exists());
|
|
|
|
|
2010-03-03 10:56:47 -08:00
|
|
|
standardInit();
|
2009-04-16 18:32:32 -07:00
|
|
|
|
2009-12-18 14:02:08 -08:00
|
|
|
// Check if available updates can be checked for
|
2010-10-19 21:28:29 -07:00
|
|
|
logTestInfo("testing nsIApplicationUpdateService:canCheckForUpdates");
|
2009-12-18 14:02:08 -08:00
|
|
|
do_check_true(gAUS.canCheckForUpdates);
|
|
|
|
// Check if updates can be applied
|
2010-10-19 21:28:29 -07:00
|
|
|
logTestInfo("testing nsIApplicationUpdateService:canApplyUpdates");
|
2009-12-18 14:02:08 -08:00
|
|
|
do_check_true(gAUS.canApplyUpdates);
|
2010-10-19 21:28:29 -07:00
|
|
|
|
|
|
|
do_test_finished();
|
|
|
|
}
|
|
|
|
|
|
|
|
function end_test() {
|
2009-05-19 13:24:12 -07:00
|
|
|
cleanUp();
|
2008-08-16 13:27:09 -07:00
|
|
|
}
|