1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/update/tests/marionette/update_smoketest_ota_same_version.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +function testSameVersion() { 1.8 + let mozSettings = window.navigator.mozSettings; 1.9 + let forceSent = false; 1.10 + 1.11 + mozSettings.addObserver("gecko.updateStatus", function statusObserver(setting) { 1.12 + if (!forceSent) { 1.13 + return; 1.14 + } 1.15 + 1.16 + mozSettings.removeObserver("gecko.updateStatus", statusObserver); 1.17 + is(setting.settingValue, "already-latest-version"); 1.18 + cleanUp(); 1.19 + }); 1.20 + 1.21 + sendContentEvent("force-update-check"); 1.22 + forceSent = true; 1.23 +} 1.24 + 1.25 +// Update lifecycle callbacks 1.26 +function preUpdate() { 1.27 + testSameVersion(); 1.28 +}