Bug 718640 - Link to view providers in other languages in Account Provisioner should be hidden if no such providers exist. r=bwinton,a=Standard8.
authorMike Conley <mconley@mozilla.com>
Wed, 25 Jan 2012 11:48:39 -0500
changeset 10128 de5589a5f7fbde02d128fce859bdc6b0e5e84277
parent 10127 265bf7f9a16891b3693c2b0649efbdaf6eaebe0b
child 10129 86e637b83cbdd511364cf5adde50215fa90587f0
push idunknown
push userunknown
push dateunknown
reviewersbwinton, Standard8
bugs718640
Bug 718640 - Link to view providers in other languages in Account Provisioner should be hidden if no such providers exist. r=bwinton,a=Standard8.
mail/test/mozmill/newmailaccount/html/providerListNoOtherLangs
mail/test/mozmill/newmailaccount/test-newmailaccount.js
mail/themes/gnomestripe/mail/newmailaccount/accountProvisioner.css
mail/themes/pinstripe/mail/newmailaccount/accountProvisioner.css
mail/themes/qute/mail/newmailaccount/accountProvisioner-aero.css
mail/themes/qute/mail/newmailaccount/accountProvisioner.css
new file mode 100644
--- /dev/null
+++ b/mail/test/mozmill/newmailaccount/html/providerListNoOtherLangs
@@ -0,0 +1,28 @@
+[{"id": "foo",
+  "label": "foo",
+  "paid": true,
+  "languages" : ["en-US"],
+  "api": "http://www.example.com/tbReg?first={firstname}&last={lastname}&email={email}",
+  "tos_url": "http://www.example.com/foo-tos",
+  "privacy_url": "http://www.example.com/foo-privacy",
+  "search_engine": "foo"
+ },
+ {"id": "bar",
+  "label": "bar",
+  "paid": false,
+  "languages" : ["en-US"],
+  "api": "http://localhost:43336/registration.html",
+  "tos_url": "http://www.example.com/bar-tos",
+  "privacy_url": "http://www.example.com/bar-privacy",
+  "search_engine": "bar"
+ },
+ {"id": "corrupt",
+  "label": "Corrupt Provider",
+  "paid": false,
+  "languages" : ["en-US"],
+  "api": "http://localhost:43336/registrationCorrupt.html",
+  "tos_url": "http://www.example.com/corrupt-tos",
+  "privacy_url": "http://www.example.com/corrupt-privacy"
+}
+
+]
--- a/mail/test/mozmill/newmailaccount/test-newmailaccount.js
+++ b/mail/test/mozmill/newmailaccount/test-newmailaccount.js
@@ -295,16 +295,17 @@ function test_can_display_providers_in_o
  * Subtest for test_can_display_providers_in_other_languages. This function
  * simply clicks on the div for displaying account providers in other
  * languages, and ensures that those other providers become visible.
  */
 function subtest_can_display_providers_in_other_languages(w) {
   wait_for_provider_list_loaded(w);
 
   // Check that the "Other languages" div is hidden
+  wait_for_element_visible(w, "otherLangDesc");
   let otherLanguages = w.window.$(".otherLanguage");
   assert_false(otherLanguages.is(":visible"));
   // Click on the "Other languages" div
   mc.click(w.eid("otherLangDesc"));
 
   wait_for_element_invisible(w, "otherLangDesc");
 }
 
@@ -866,8 +867,34 @@ function test_can_pref_off_account_provi
   close_window(wizard);
 
   // And finally restore the menu to the way it was.
   newMenuPopup.getNode().allowevents = oldAllowEvents;
 }
 
 // We cannot control menus via Mozmill in OSX, so we'll skip this test.
 test_can_pref_off_account_provisioner.EXCLUDED_PLATFORMS = ['darwin'];
+
+/**
+ * Tests that if we load a provider list that does not include providers in
+ * other languages, then the "show me providers in other languages" link is
+ * hidden.
+ */
+function test_other_lang_link_hides() {
+  let original = Services.prefs.getCharPref(kProviderListPref);
+  Services.prefs.setCharPref(kProviderListPref, url + "providerListNoOtherLangs");
+
+  plan_for_modal_dialog("AccountCreation",
+                        subtest_other_lang_link_hides);
+  open_provisioner_window();
+  wait_for_modal_dialog("AccountCreation");
+  Services.prefs.setCharPref(kProviderListPref, original);
+}
+
+/**
+ * Subtest for test_other_lang_link_hides that just waits for the provider list
+ * to be loaded, and then ensures that the "show me providers in other
+ * languages" link is not visible.
+ */
+function subtest_other_lang_link_hides(w) {
+  wait_for_provider_list_loaded(w);
+  wait_for_element_invisible(w, "otherLangDesc");
+}
--- a/mail/themes/gnomestripe/mail/newmailaccount/accountProvisioner.css
+++ b/mail/themes/gnomestripe/mail/newmailaccount/accountProvisioner.css
@@ -140,17 +140,17 @@ input[type="submit"][disabled="true"], i
   word-wrap: break-word;
 }
 
 #providers input[type="checkbox"] {
   vertical-align: middle;
 }
 
 .otherLanguage,
-#otherLanguages {
+#otherLangDesc {
   display: none;
 }
 
 #otherLangDesc {
   text-decoration: underline;
   cursor: pointer;
   font-size: x-small;
   margin-top: 9px;
--- a/mail/themes/pinstripe/mail/newmailaccount/accountProvisioner.css
+++ b/mail/themes/pinstripe/mail/newmailaccount/accountProvisioner.css
@@ -140,17 +140,17 @@ input[type="submit"][disabled="true"], i
   word-wrap: break-word;
 }
 
 #providers input[type="checkbox"] {
   vertical-align: middle;
 }
 
 .otherLanguage,
-#otherLanguages {
+#otherLangDesc {
   display: none;
 }
 
 #otherLangDesc {
   text-decoration: underline;
   cursor: pointer;
   font-size: x-small;
   margin-top: 9px;
--- a/mail/themes/qute/mail/newmailaccount/accountProvisioner-aero.css
+++ b/mail/themes/qute/mail/newmailaccount/accountProvisioner-aero.css
@@ -140,17 +140,17 @@ input[type="submit"][disabled="true"], i
   word-wrap: break-word;
 }
 
 #providers input[type="checkbox"] {
   vertical-align: middle;
 }
 
 .otherLanguage,
-#otherLanguages {
+#otherLangDesc {
   display: none;
 }
 
 #otherLangDesc {
   text-decoration: underline;
   cursor: pointer;
   font-size: x-small;
   margin-top: 9px;
--- a/mail/themes/qute/mail/newmailaccount/accountProvisioner.css
+++ b/mail/themes/qute/mail/newmailaccount/accountProvisioner.css
@@ -140,17 +140,17 @@ input[type="submit"][disabled="true"], i
   word-wrap: break-word;
 }
 
 #providers input[type="checkbox"] {
   vertical-align: middle;
 }
 
 .otherLanguage,
-#otherLanguages {
+#otherLangDesc {
   display: none;
 }
 
 #otherLangDesc {
   text-decoration: underline;
   cursor: pointer;
   font-size: x-small;
   margin-top: 9px;