summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view_unittest.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 06:18:58 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 06:18:58 +0000
commite738ea51ac8011f8c16c10666fba1bb7b930fbb3 (patch)
tree65cdae9bce903f5a7717d1242e8d640d70ab51d0 /chrome/renderer/render_view_unittest.cc
parent779aae5fa525671293b0db3ddad27cc3811a362a (diff)
downloadchromium_src-e738ea51ac8011f8c16c10666fba1bb7b930fbb3.zip
chromium_src-e738ea51ac8011f8c16c10666fba1bb7b930fbb3.tar.gz
chromium_src-e738ea51ac8011f8c16c10666fba1bb7b930fbb3.tar.bz2
Reverting 11953.
Review URL: http://codereview.chromium.org/48121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11954 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view_unittest.cc')
-rw-r--r--chrome/renderer/render_view_unittest.cc48
1 files changed, 0 insertions, 48 deletions
diff --git a/chrome/renderer/render_view_unittest.cc b/chrome/renderer/render_view_unittest.cc
index a643052..e81cf4f 100644
--- a/chrome/renderer/render_view_unittest.cc
+++ b/chrome/renderer/render_view_unittest.cc
@@ -317,51 +317,3 @@ TEST_F(RenderViewTest, ImeComposition) {
}
}
}
-
-// Test that the RenderView::OnSetTextDirection() function can change the text
-// direction of the selected input element.
-TEST_F(RenderViewTest, OnSetTextDirection) {
- // Load an HTML page consisting of a <textarea> element and a <div> element.
- // This test changes the text direction of the <textarea> element, and
- // writes the values of its 'dir' attribute and its 'direction' property to
- // verify that the text direction is changed.
- view_->set_delay_seconds_for_form_state_sync(0);
- LoadHTML("<html>"
- "<head>"
- "</head>"
- "<body>"
- "<textarea id=\"test\"></textarea>"
- "<div id=\"result\" contenteditable=\"true\"></div>"
- "</body>"
- "</html>");
- render_thread_.sink().ClearMessages();
-
- static const struct {
- WebTextDirection direction;
- const wchar_t* expected_result;
- } kTextDirection[] = {
- {WEB_TEXT_DIRECTION_RTL, L"\x000A" L"rtl,rtl"},
- {WEB_TEXT_DIRECTION_LTR, L"\x000A" L"ltr,ltr"},
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTextDirection); ++i) {
- // Set the text direction of the <textarea> element.
- ExecuteJavaScript("document.getElementById('test').focus();");
- view_->OnSetTextDirection(kTextDirection[i].direction);
-
- // Write the values of its DOM 'dir' attribute and its CSS 'direction'
- // property to the <div> element.
- ExecuteJavaScript("var result = document.getElementById('result');"
- "var node = document.getElementById('test');"
- "var style = getComputedStyle(node, null);"
- "result.innerText ="
- " node.getAttribute('dir') + ',' +"
- " style.getPropertyValue('direction');");
-
- // Copy the document content to std::wstring and compare with the
- // expected result.
- const int kMaxOutputCharacters = 16;
- std::wstring output;
- GetMainFrame()->GetContentAsPlainText(kMaxOutputCharacters, &output);
- EXPECT_EQ(output, kTextDirection[i].expected_result);
- }
-}