Bug 1016342 - build translation by default, r=felipe.
authorFlorian Quèze <florian@queze.net>
Wed, 28 May 2014 00:45:45 +0200
changeset 185193 fa11a3abecacdec6297a3a52684fc503ac9bbb42
parent 185192 d38acfe08ecda41a419ae7c07b9c8d88a4c4c06a
child 185194 dec2079dcd1344c7595987c04d591e0258d1498d
push id26845
push userttaubert@mozilla.com
push dateWed, 28 May 2014 09:38:38 +0000
treeherdermozilla-central@e017c15325ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1016342
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1016342 - build translation by default, r=felipe.
browser/components/moz.build
browser/components/translation/test/browser_translation_exceptions.js
browser/components/translation/test/browser_translation_infobar.js
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -13,16 +13,17 @@ PARALLEL_DIRS += [
     'places',
     'preferences',
     'privatebrowsing',
     'search',
     'sessionstore',
     'shell',
     'sidebar',
     'tabview',
+    'translation',
     'migration',
 ]
 
 DIRS += ['build']
 
 XPIDL_SOURCES += [
     'nsIBrowserGlue.idl',
     'nsIBrowserHandler.idl',
--- a/browser/components/translation/test/browser_translation_exceptions.js
+++ b/browser/components/translation/test/browser_translation_exceptions.js
@@ -2,24 +2,27 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // tests the translation infobar, using a fake 'Translation' implementation.
 
 Components.utils.import("resource:///modules/translation/Translation.jsm");
 
 const kLanguagesPref = "browser.translation.neverForLanguages";
+const kShowUIPref = "browser.translation.ui.show";
 
 function test() {
   waitForExplicitFinish();
 
+  Services.prefs.setBoolPref(kShowUIPref, true);
   let tab = gBrowser.addTab();
   gBrowser.selectedTab = tab;
   registerCleanupFunction(function () {
     gBrowser.removeTab(tab);
+    Services.prefs.clearUserPref(kShowUIPref);
   });
   tab.linkedBrowser.addEventListener("load", function onload() {
     tab.linkedBrowser.removeEventListener("load", onload, true);
     Task.spawn(function* () {
       for (let test of gTests) {
         info(test.desc);
         yield test.run();
       }
--- a/browser/components/translation/test/browser_translation_infobar.js
+++ b/browser/components/translation/test/browser_translation_infobar.js
@@ -1,16 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // tests the translation infobar, using a fake 'Translation' implementation.
 
 Components.utils.import("resource:///modules/translation/Translation.jsm");
 
+const kShowUIPref = "browser.translation.ui.show";
+
 function waitForCondition(condition, nextTest, errorMsg) {
   var tries = 0;
   var interval = setInterval(function() {
     if (tries >= 30) {
       ok(false, errorMsg);
       moveOn();
     }
     var conditionPassed;
@@ -63,23 +65,25 @@ function showTranslationUI(aDetectedLang
 
 function hasTranslationInfoBar() {
   return !!gBrowser.getNotificationBox().getNotificationWithValue("translation");
 }
 
 function test() {
   waitForExplicitFinish();
 
+  Services.prefs.setBoolPref(kShowUIPref, true);
   let tab = gBrowser.addTab();
   gBrowser.selectedTab = tab;
   tab.linkedBrowser.addEventListener("load", function onload() {
     tab.linkedBrowser.removeEventListener("load", onload, true);
     TranslationStub.browser = gBrowser.selectedBrowser;
     registerCleanupFunction(function () {
       gBrowser.removeTab(tab);
+      Services.prefs.clearUserPref(kShowUIPref);
     });
     run_tests(() => {
       finish();
     });
   }, true);
 
   content.location = "data:text/plain,test page";
 }