michael@0: /* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * Test with sessionCheckpoints.json containing valid data michael@0: */ michael@0: add_task(function test_valid_file() { michael@0: // Write valid data to checkpoint file michael@0: let data = JSON.stringify({"final-ui-startup": true}); michael@0: yield OS.File.writeAtomic(sessionCheckpointsPath, data, michael@0: {tmpPath: sessionCheckpointsPath + ".tmp"}); michael@0: michael@0: CrashMonitor.init(); michael@0: let checkpoints = yield CrashMonitor.previousCheckpoints; michael@0: michael@0: do_check_true(checkpoints["final-ui-startup"]); michael@0: do_check_eq(Object.keys(checkpoints).length, 1); michael@0: });