Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1001167 - Don't let invalid sessionstore.js files break sessionst…
…ore. r=smacleod, a=lsblakk
- Loading branch information
Tim Taubert
committed
Apr 25, 2014
1 parent
00a42c1
commit d35367b
Showing
4 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
browser/components/sessionstore/test/unit/data/sessionstore_invalid.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"windows": // invalid json | ||
} |
21 changes: 21 additions & 0 deletions
21
browser/components/sessionstore/test/unit/test_startup_invalid_session.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
function run_test() { | ||
let profd = do_get_profile(); | ||
|
||
let sourceSession = do_get_file("data/sessionstore_invalid.js"); | ||
sourceSession.copyTo(profd, "sessionstore.js"); | ||
|
||
let sourceCheckpoints = do_get_file("data/sessionCheckpoints_all.json"); | ||
sourceCheckpoints.copyTo(profd, "sessionCheckpoints.json"); | ||
|
||
do_test_pending(); | ||
let startup = Cc["@mozilla.org/browser/sessionstartup;1"]. | ||
getService(Ci.nsISessionStartup); | ||
|
||
afterSessionStartupInitialization(function cb() { | ||
do_check_eq(startup.sessionType, Ci.nsISessionStartup.NO_SESSION); | ||
do_test_finished(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters