xpcom/tests/unit/test_mac_bundle.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/tests/unit/test_mac_bundle.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,17 @@
     1.4 +function run_test() { 
     1.5 +  // this is a hack to skip the rest of the code on non-Mac platforms, 
     1.6 +  // since #ifdef is not available to xpcshell tests...
     1.7 +  if (!("nsILocalFileMac" in Components.interfaces))
     1.8 +    return;
     1.9 +  
    1.10 +  // OK, here's the real part of the test:
    1.11 +  // make sure these two test bundles are recognized as bundles (or "packages") 
    1.12 +  var keynoteBundle = do_get_file("data/presentation.key");
    1.13 +  var appBundle = do_get_file("data/SmallApp.app");
    1.14 +  
    1.15 +  do_check_true(keynoteBundle instanceof Components.interfaces.nsILocalFileMac);
    1.16 +  do_check_true(appBundle instanceof Components.interfaces.nsILocalFileMac);
    1.17 +  
    1.18 +  do_check_true(keynoteBundle.isPackage());
    1.19 +  do_check_true(appBundle.isPackage());
    1.20 +}

mercurial