browser/components/sessionstore/test/unit/test_startup_session_async.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/sessionstore/test/unit/test_startup_session_async.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +
     1.8 +// Test nsISessionStartup.sessionType in the following scenario:
     1.9 +// - valid sessionstore.js;
    1.10 +// - valid sessionCheckpoints.json with all checkpoints;
    1.11 +// - the session store has been loaded
    1.12 +
    1.13 +function run_test() {
    1.14 +  let profd = do_get_profile();
    1.15 +
    1.16 +  let sourceSession = do_get_file("data/sessionstore_valid.js");
    1.17 +  sourceSession.copyTo(profd, "sessionstore.js");
    1.18 +
    1.19 +  let sourceCheckpoints = do_get_file("data/sessionCheckpoints_all.json");
    1.20 +  sourceCheckpoints.copyTo(profd, "sessionCheckpoints.json");
    1.21 +
    1.22 +  do_test_pending();
    1.23 +  let startup = Cc["@mozilla.org/browser/sessionstartup;1"].
    1.24 +    getService(Ci.nsISessionStartup);
    1.25 +
    1.26 +  afterSessionStartupInitialization(function cb() {
    1.27 +    do_check_eq(startup.sessionType, Ci.nsISessionStartup.DEFER_SESSION);
    1.28 +    do_test_finished();
    1.29 +  });
    1.30 +}

mercurial