/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; /** * Request 2x longer timeout for this test. * There are lot of test cases in this file, but they are all of the same nature, * and it makes the most sense to have them all in this single test file. */ requestLongerTimeout(2); add_task( async function test_direction_ltr_to_rtl_basic_content_not_attributes() { const { translate, htmlMatches, cleanup } = await createTranslationsDoc( /* html */ `
This block of content should get RTL direction.
Div text. Span within a div.
Span text.
Div within a span.
`, { sourceLanguage: "en", targetLanguage: "ar" } ); translate(); await htmlMatches( 'LTR to RTL (basic): content elements get dir="rtl", but attribute-only elements do not.', /* html */ `
THIS BLOCK OF CONTENT SHOULD GET RTL DIRECTION.
DIV TEXT. SPAN WITHIN A DIV.
SPAN TEXT.
DIV WITHIN A SPAN.
` ); cleanup(); } ); add_task(async function test_direction_ltr_to_rtl_lists_ul_basic() { const { translate, htmlMatches, cleanup } = await createTranslationsDoc( /* html */ ` `, { sourceLanguage: "en", targetLanguage: "ar" } ); translate(); await htmlMatches( "LTR to RTL (UL basic):