This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32541 from Cwiiis/bug1191745-bug1202422-reland
Bug 1191745 - Switch to new home screen by default + Bug 1202422 - Migrate from verticalhome to homescreen
- Loading branch information
Showing
65 changed files
with
748 additions
and
258 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
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
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
13 changes: 13 additions & 0 deletions
13
apps/homescreen/test/marionette/client_options_verticalhome.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,13 @@ | ||
module.exports = { | ||
prefs: { | ||
'dom.webcomponents.enabled': true, | ||
'dom.mozApps.homescreenURL': | ||
'app://homescreen.gaiamobile.org/manifest.webapp' | ||
}, | ||
settings: { | ||
'devtools.qps.enabled': false, | ||
'language.current': 'en-US', | ||
'homescreen.manifestURL': | ||
'app://verticalhome.gaiamobile.org/manifest.webapp' | ||
} | ||
}; |
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
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 |
---|---|---|
|
@@ -27,3 +27,4 @@ | |
[layout_test.js] | ||
[localization_test.js] | ||
[pinning_the_web_test.js] | ||
[verticalhome_migration_test.js] |
60 changes: 60 additions & 0 deletions
60
apps/homescreen/test/marionette/verticalhome_migration_test.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,60 @@ | ||
'use strict'; | ||
/* global __dirname */ | ||
|
||
var assert = require('assert'); | ||
|
||
marionette('Homescreen - verticalhome migration', function() { | ||
var client = marionette.client({ | ||
profile: require(__dirname + '/client_options_verticalhome.js') | ||
}); | ||
var actions, verticalhome, home, system; | ||
|
||
setup(function() { | ||
actions = client.loader.getActions(); | ||
verticalhome = client.loader.getAppClass('verticalhome'); | ||
home = client.loader.getAppClass('homescreen'); | ||
system = client.loader.getAppClass('system'); | ||
system.waitForFullyLoaded(); | ||
verticalhome.waitForLaunch(); | ||
}); | ||
|
||
test('App order is imported from verticalhome', function() { | ||
// Drag the second icon to the first position so we differ from the | ||
// default settings. | ||
var icon1 = verticalhome.getNthIcon(1); | ||
var icon2 = verticalhome.getNthIcon(2); | ||
actions.press(icon2).wait(1).move(icon1).release().wait(1).perform(); | ||
verticalhome.exitEditMode(); | ||
|
||
// Restart the home screen so that icon DOM order corresponds with actual | ||
// order. | ||
verticalhome.restart(); | ||
|
||
// Record the names of all the apps and bookmarks (these are the only | ||
// items that are migrated) | ||
var iconNames = | ||
client.findElements('#icons div.icon:not(.placeholder):not(.collection)'). | ||
map(function(icon) { | ||
return icon.findElement('.title').text(); | ||
}); | ||
|
||
// Request migration to new home screen | ||
client.executeScript(function() { | ||
window.wrappedJSObject.app.itemStore.migrate( | ||
'app://homescreen.gaiamobile.org/manifest.webapp'); | ||
}); | ||
client.switchToFrame(); | ||
home.waitForLaunch(); | ||
|
||
// Verify icon order matches | ||
var importedIconNames = home.visibleIcons.map(function(icon) { | ||
return home.getIconText(icon); | ||
}); | ||
|
||
var nIcons = iconNames.length; | ||
assert.equal(importedIconNames.length, nIcons); | ||
for (var i = 0; i < nIcons; i++) { | ||
assert.equal(importedIconNames[i], iconNames[i]); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.