Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #17539 from KevinGrandon/bug_967516_enable_device_…
Browse files Browse the repository at this point in the history
…debug_default

Bug 967516 - Enable DEVICE_DEBUG by default for non production builds r=ochameau
  • Loading branch information
rvandermeulen committed Mar 26, 2014
2 parents 8294e94 + ddcc8f2 commit 5ad38b9
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ GAIA_DOMAIN?=gaiamobile.org
DEBUG?=0
DEVICE_DEBUG?=0
NO_LOCK_SCREEN?=0
SCREEN_TIMEOUT?=undefined
PRODUCTION?=0
DESKTOP_SHIMS?=0
GAIA_OPTIMIZE?=0
Expand Down Expand Up @@ -102,6 +103,7 @@ ifeq ($(SIMULATOR),1)
DESKTOP=1
NOFTU=1
DEVICE_DEBUG=1
NO_LOCK_SCREEN=1
endif

# Enable compatibility to run in Firefox Desktop
Expand All @@ -111,11 +113,6 @@ NOFTU?=0
# Automatically enable remote debugger
REMOTE_DEBUGGER?=0

ifeq ($(DEVICE_DEBUG),1)
REMOTE_DEBUGGER=1
NO_LOCK_SCREEN=1
endif

# We also disable FTU when running in Firefox or in debug mode
ifeq ($(DEBUG),1)
NOFTU=1
Expand Down Expand Up @@ -177,6 +174,17 @@ endif
ifeq ($(PRODUCTION), 1)
GAIA_OPTIMIZE=1
GAIA_APP_TARGET=production
else
DEVICE_DEBUG=1
endif

ifeq ($(DEVICE_DEBUG),1)
REMOTE_DEBUGGER=1
SCREEN_TIMEOUT=600
endif

ifeq ($(SIMULATOR),1)
SCREEN_TIMEOUT=0
endif

ifeq ($(DOGFOOD), 1)
Expand Down Expand Up @@ -383,6 +391,7 @@ define BUILD_CONFIG
"DESKTOP" : $(DESKTOP), \
"DEVICE_DEBUG" : $(DEVICE_DEBUG), \
"NO_LOCK_SCREEN" : $(NO_LOCK_SCREEN), \
"SCREEN_TIMEOUT" : $(SCREEN_TIMEOUT), \
"HOMESCREEN" : "$(HOMESCREEN)", \
"GAIA_PORT" : "$(GAIA_PORT)", \
"GAIA_LOCALES_PATH" : "$(GAIA_LOCALES_PATH)", \
Expand Down
6 changes: 5 additions & 1 deletion build/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,19 @@ function execute(config) {
}

if (config.NO_LOCK_SCREEN) {
settings['screen.timeout'] = 0;
settings['lockscreen.enabled'] = false;
settings['lockscreen.locked'] = false;
}

if (typeof(config.SCREEN_TIMEOUT) == 'number') {
settings['screen.timeout'] = config.SCREEN_TIMEOUT;
}

setDefaultKeyboardLayouts(config.GAIA_DEFAULT_LOCALE, settings, config);

// Ensure not quitting xpcshell before all asynchronous code is done
utils.processEvents(function(){return {wait : false}});

var queue = utils.Q.defer();
queue.resolve();

Expand Down
8 changes: 6 additions & 2 deletions build/test/integration/build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ suite('Build Integration tests', function() {
var ignoreSettings = [
'apz.force-enable',
'debug.console.enabled',
'developer.menu.enabled'
'developer.menu.enabled',
'screen.timeout',
'lockscreen.enabled',
'lockscreen.locked'
];
ignoreSettings.forEach(function(key) {
if (commonSettings[key] !== undefined) {
Expand Down Expand Up @@ -332,7 +335,8 @@ suite('Build Integration tests', function() {
'installed-extensions.json');
var expectedSettings = {
'homescreen.manifestURL': 'http://homescreen.gaiamobile.org:8080/manifest.webapp',
'rocketbar.searchAppURL': 'http://search.gaiamobile.org:8080/index.html'
'rocketbar.searchAppURL': 'http://search.gaiamobile.org:8080/index.html',
'screen.timeout': 600
};
var expectedUserPrefs = {
'browser.manifestURL': 'http://system.gaiamobile.org:8080/manifest.webapp',
Expand Down
26 changes: 25 additions & 1 deletion build/test/unit/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ suite('settings.js', function() {
config.GAIA_DOMAIN + config.GAIA_PORT + '/index.html',
'language.current': config.GAIA_DEFAULT_LOCALE,
'debugger.remote-mode': 'adb-devtools',
'screen.timeout': 0,
'lockscreen.enabled': false,
'lockscreen.locked': false,
'wallpaper.image': undefined,
Expand All @@ -274,6 +273,31 @@ suite('settings.js', function() {
});
});


test('SCREEN_TIMEOUT === 600', function(done) {
config.SCREEN_TIMEOUT = 600;
var queue = app.execute(config);
queue.done(function(result) {
assert.deepEqual({
'debug.console.enabled': true,
'developer.menu.enabled': true,
'apz.force-enable': true,
'homescreen.manifestURL': config.GAIA_SCHEME +
'homescreen.' + config.GAIA_DOMAIN + config.GAIA_PORT +
'/manifest.webapp',
'rocketbar.searchAppURL': config.GAIA_SCHEME + 'search.' +
config.GAIA_DOMAIN + config.GAIA_PORT + '/index.html',
'debugger.remote-mode': 'adb-only',
'language.current': config.GAIA_DEFAULT_LOCALE,
'screen.timeout': 600,
'wallpaper.image': undefined,
'dialer.ringtone': undefined,
'notification.ringtone': undefined },
result);
done();
});
});

teardown(function() {
config = {};
});
Expand Down

0 comments on commit 5ad38b9

Please sign in to comment.