Backed out changeset 686282bd2f19 (bug 1312049)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 29 Oct 2016 15:28:01 +0200
changeset 320149 950739a54a07f38d8659da430429892a65967983
parent 320148 1b170b39ed6bdbde366233ab84594bdaaa960a5a
child 320150 969c3295d3aa77931cca26eddb047d9d74bd9858
push id20750
push userarchaeopteryx@coole-files.de
push dateSat, 29 Oct 2016 13:34:32 +0000
treeherderfx-team@969c3295d3aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1312049
milestone52.0a1
backs out686282bd2f19b5f0ab249cde34caea04fc5c17a1
Backed out changeset 686282bd2f19 (bug 1312049) MozReview-Commit-ID: G1rcAOb4c0O
toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
toolkit/content/tests/chrome/chrome.ini
--- a/toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
@@ -34,17 +34,17 @@ add_task(function* test_i18n_css() {
 
         browser.test.notifyPass("i18n-css");
       });
 
       browser.test.sendMessage("ready", browser.runtime.getURL("foo.css"));
     },
 
     manifest: {
-      "web_accessible_resources": ["foo.css", "foo.txt"],
+      "web_accessible_resources": ["foo.css", "foo.txt", "locale.css"],
 
       "content_scripts": [{
         "matches": ["http://mochi.test/*/file_sample.html"],
         "css": ["foo.css"],
       }],
 
       "default_locale": "en",
     },
@@ -55,16 +55,17 @@ add_task(function* test_i18n_css() {
           "message": "max-width: 42px",
           "description": "foo",
         },
       }),
 
       "foo.css": "body { __MSG_foo__; }",
       "bar.CsS": "body { __MSG_foo__; }",
       "foo.txt": "body { __MSG_foo__; }",
+      "locale.css": '* { content: "__MSG_@@ui_locale__ __MSG_@@bidi_dir__ __MSG_@@bidi_reversed_dir__ __MSG_@@bidi_start_edge__ __MSG_@@bidi_end_edge__" }',
     },
   });
 
   yield extension.startup();
   let cssURL = yield extension.awaitMessage("ready");
 
   function fetch(url) {
     return new Promise((resolve, reject) => {
@@ -82,15 +83,34 @@ add_task(function* test_i18n_css() {
 
   let win = window.open("file_sample.html");
   yield waitForLoad(win);
 
   let style = win.getComputedStyle(win.document.body);
   is(style.maxWidth, "42px", "stylesheet correctly applied");
   win.close();
 
+  cssURL = cssURL.replace(/foo.css$/, "locale.css");
+
+  css = yield fetch(cssURL);
+  is(css, '* { content: "en_US ltr rtl left right" }', "CSS file localized in mochitest scope");
+
+  const LOCALE = "general.useragent.locale";
+  const DIR = "intl.uidirection.en";
+
+  // We don't wind up actually switching the chrome registry locale, since we
+  // don't have a chrome package for Hebrew. So just override it.
+  SpecialPowers.setCharPref(LOCALE, "he");
+  SpecialPowers.setCharPref(DIR, "rtl");
+
+  css = yield fetch(cssURL);
+  is(css, '* { content: "he rtl ltr right left" }', "CSS file localized in mochitest scope");
+
+  SpecialPowers.clearUserPref(LOCALE);
+  SpecialPowers.clearUserPref(DIR);
+
   yield extension.awaitFinish("i18n-css");
   yield extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/toolkit/content/tests/chrome/chrome.ini
+++ b/toolkit/content/tests/chrome/chrome.ini
@@ -74,17 +74,16 @@ subsuite = clipboard
 skip-if = os == 'linux' # Bug 1264604
 [test_bug365773.xul]
 [test_bug366992.xul]
 [test_bug382990.xul]
 [test_bug409624.xul]
 [test_bug418874.xul]
 [test_bug429723.xul]
 [test_bug437844.xul]
-disabled = # bug 1312049 prevents this test working in its current form
 [test_bug457632.xul]
 [test_bug460942.xul]
 [test_bug471776.xul]
 [test_bug509732.xul]
 [test_bug554279.xul]
 [test_bug557987.xul]
 [test_bug562554.xul]
 [test_bug570192.xul]
@@ -158,17 +157,16 @@ skip-if = os == 'linux' && asan # Bug 12
 support-files = window_preferences_beforeaccept.xul
 [test_preferences_onsyncfrompreference.xul]
 support-files = window_preferences_onsyncfrompreference.xul
 [test_progressmeter.xul]
 [test_props.xul]
 [test_radio.xul]
 [test_richlist_direction.xul]
 [test_righttoleft.xul]
-disabled = # bug 1312049 prevents this test working in its current form
 [test_scale.xul]
 [test_scaledrag.xul]
 skip-if = buildapp == 'mulet'
 [test_screenPersistence.xul]
 [test_scrollbar.xul]
 skip-if = buildapp == 'mulet'
 [test_showcaret.xul]
 [test_sorttemplate.xul]