Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
67
gaia/apps/ftu/test/marionette/ftu_upgrade.js
Executable file
67
gaia/apps/ftu/test/marionette/ftu_upgrade.js
Executable file
|
|
@ -0,0 +1,67 @@
|
|||
'use strict';
|
||||
|
||||
var assert = require('assert');
|
||||
var Ftu = require('./lib/ftu');
|
||||
|
||||
marionette('First Time Use >', function() {
|
||||
var ftu, system;
|
||||
var client = marionette.client({
|
||||
profile: {
|
||||
prefs: {
|
||||
'focusmanager.testmode': true
|
||||
},
|
||||
settings: {
|
||||
'ftu.manifestURL': 'app://ftu.gaiamobile.org/manifest.webapp',
|
||||
'deviceinfo.os': '1.3.1-foo',
|
||||
'deviceinfo.previous_os': '3.0.0-bar'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setup(function() {
|
||||
client.executeAsyncScript(function() {
|
||||
var req = navigator.mozSettings.createLock().set({
|
||||
'deviceinfo.os': '1.3.1-foo',
|
||||
'deviceinfo.previous_os': '3.0.0-bar'
|
||||
});
|
||||
req.onsuccess = function(evt) {
|
||||
window.addEventListener('starting', function onevent(evt) {
|
||||
window.wrappedJSObject.asyncStorage.setItem('ftu.enabled', false);
|
||||
marionetteScriptFinished();
|
||||
});
|
||||
};
|
||||
req.onerror = marionetteScriptFinished;
|
||||
});
|
||||
system = client.loader.getAppClass('system');
|
||||
ftu = new Ftu(client);
|
||||
system.waitForFullyLoaded();
|
||||
});
|
||||
|
||||
test('FTU launches for upgrade when disabled', function() {
|
||||
client.switchToFrame();
|
||||
var isEnabled = client.executeAsyncScript(function() {
|
||||
var asyncStorage = window.wrappedJSObject.asyncStorage;
|
||||
asyncStorage.getItem('ftu.enabled', function(result) {
|
||||
return marionetteScriptFinished(result);
|
||||
});
|
||||
});
|
||||
assert.equal(false, isEnabled);
|
||||
client.apps.switchToApp(Ftu.URL);
|
||||
client.helper.waitForElement('#update-screen');
|
||||
});
|
||||
|
||||
test('Sets appropriate theme color', function() {
|
||||
client.apps.switchToApp(Ftu.URL);
|
||||
client.helper.waitForElement('#update-screen');
|
||||
var expectedColor = client.executeScript(function() {
|
||||
return window.wrappedJSObject.UIManager.DARK_THEME;
|
||||
});
|
||||
client.waitFor(function() {
|
||||
var themeColor = client.executeScript(function() {
|
||||
var meta = document.querySelector('meta[name="theme-color"]');
|
||||
return meta.getAttribute('content');
|
||||
});
|
||||
return (themeColor == expectedColor);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue