| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 | 6 |
| 7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 | 1018 |
| 1019 // Copy the document content to std::wstring and compare with the | 1019 // Copy the document content to std::wstring and compare with the |
| 1020 // expected result. | 1020 // expected result. |
| 1021 const int kMaxOutputCharacters = 16; | 1021 const int kMaxOutputCharacters = 16; |
| 1022 std::wstring output = UTF16ToWideHack( | 1022 std::wstring output = UTF16ToWideHack( |
| 1023 GetMainFrame()->contentAsText(kMaxOutputCharacters)); | 1023 GetMainFrame()->contentAsText(kMaxOutputCharacters)); |
| 1024 EXPECT_EQ(output, kTextDirection[i].expected_result); | 1024 EXPECT_EQ(output, kTextDirection[i].expected_result); |
| 1025 } | 1025 } |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 // see http://crbug.com/238750 |
| 1029 #if defined(OS_WIN) |
| 1030 #define MAYBE_OnHandleKeyboardEvent DISABLED_OnHandleKeyboardEvent |
| 1031 #else |
| 1032 #define MAYBE_OnHandleKeyboardEvent OnHandleKeyboardEvent |
| 1033 #endif |
| 1034 |
| 1028 // Test that we can receive correct DOM events when we send input events | 1035 // Test that we can receive correct DOM events when we send input events |
| 1029 // through the RenderWidget::OnHandleInputEvent() function. | 1036 // through the RenderWidget::OnHandleInputEvent() function. |
| 1030 TEST_F(RenderViewImplTest, OnHandleKeyboardEvent) { | 1037 TEST_F(RenderViewImplTest, MAYBE_OnHandleKeyboardEvent) { |
| 1031 #if !defined(OS_MACOSX) | 1038 #if !defined(OS_MACOSX) |
| 1032 // Load an HTML page consisting of one <input> element and three | 1039 // Load an HTML page consisting of one <input> element and three |
| 1033 // contentediable <div> elements. | 1040 // contentediable <div> elements. |
| 1034 // The <input> element is used for sending keyboard events, and the <div> | 1041 // The <input> element is used for sending keyboard events, and the <div> |
| 1035 // elements are used for writing DOM events in the following format: | 1042 // elements are used for writing DOM events in the following format: |
| 1036 // "<keyCode>,<shiftKey>,<controlKey>,<altKey>". | 1043 // "<keyCode>,<shiftKey>,<controlKey>,<altKey>". |
| 1037 // TODO(hbono): <http://crbug.com/2215> Our WebKit port set |ev.metaKey| to | 1044 // TODO(hbono): <http://crbug.com/2215> Our WebKit port set |ev.metaKey| to |
| 1038 // true when pressing an alt key, i.e. the |ev.metaKey| value is not | 1045 // true when pressing an alt key, i.e. the |ev.metaKey| value is not |
| 1039 // trustworthy. We will check the |ev.metaKey| value when this issue is fixed. | 1046 // trustworthy. We will check the |ev.metaKey| value when this issue is fixed. |
| 1040 view()->set_send_content_state_immediately(true); | 1047 view()->set_send_content_state_immediately(true); |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 | 1849 |
| 1843 // Copy the document content to std::wstring and compare with the | 1850 // Copy the document content to std::wstring and compare with the |
| 1844 // expected result. | 1851 // expected result. |
| 1845 const int kMaxOutputCharacters = 256; | 1852 const int kMaxOutputCharacters = 256; |
| 1846 std::wstring output = UTF16ToWideHack( | 1853 std::wstring output = UTF16ToWideHack( |
| 1847 GetMainFrame()->contentAsText(kMaxOutputCharacters)); | 1854 GetMainFrame()->contentAsText(kMaxOutputCharacters)); |
| 1848 EXPECT_EQ(output, L"hello \n\nworld"); | 1855 EXPECT_EQ(output, L"hello \n\nworld"); |
| 1849 } | 1856 } |
| 1850 | 1857 |
| 1851 } // namespace content | 1858 } // namespace content |
| OLD | NEW |