| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 // our JavaScript function. (See the above comment for the format.) | 671 // our JavaScript function. (See the above comment for the format.) |
| 672 static char expected_result[1024]; | 672 static char expected_result[1024]; |
| 673 expected_result[0] = NULL; | 673 expected_result[0] = NULL; |
| 674 base::snprintf(&expected_result[0], | 674 base::snprintf(&expected_result[0], |
| 675 sizeof(expected_result), | 675 sizeof(expected_result), |
| 676 "\n" // texts in the <input> element | 676 "\n" // texts in the <input> element |
| 677 "%d,%s\n" // texts in the first <div> element | 677 "%d,%s\n" // texts in the first <div> element |
| 678 "%d,%s\n" // texts in the second <div> element | 678 "%d,%s\n" // texts in the second <div> element |
| 679 "%d,%s", // texts in the third <div> element | 679 "%d,%s", // texts in the third <div> element |
| 680 key_code, kModifierData[j].expected_result, | 680 key_code, kModifierData[j].expected_result, |
| 681 char_code[0], kModifierData[j].expected_result, | 681 static_cast<int>(char_code[0]), |
| 682 kModifierData[j].expected_result, |
| 682 key_code, kModifierData[j].expected_result); | 683 key_code, kModifierData[j].expected_result); |
| 683 | 684 |
| 684 // Retrieve the text in the test page and compare it with the expected | 685 // Retrieve the text in the test page and compare it with the expected |
| 685 // text created from a virtual-key code, a character code, and the | 686 // text created from a virtual-key code, a character code, and the |
| 686 // modifier-key status. | 687 // modifier-key status. |
| 687 const int kMaxOutputCharacters = 1024; | 688 const int kMaxOutputCharacters = 1024; |
| 688 std::string output = UTF16ToUTF8( | 689 std::string output = UTF16ToUTF8( |
| 689 GetMainFrame()->contentAsText(kMaxOutputCharacters)); | 690 GetMainFrame()->contentAsText(kMaxOutputCharacters)); |
| 690 EXPECT_EQ(expected_result, output); | 691 EXPECT_EQ(expected_result, output); |
| 691 } | 692 } |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 LoadHTML("<html><head><meta http-equiv=\"content-language\" " | 1220 LoadHTML("<html><head><meta http-equiv=\"content-language\" " |
| 1220 "content=\" fr , es,en \">" | 1221 "content=\" fr , es,en \">" |
| 1221 "</head><body>A random page with random content.</body></html>"); | 1222 "</head><body>A random page with random content.</body></html>"); |
| 1222 ProcessPendingMessages(); | 1223 ProcessPendingMessages(); |
| 1223 message = render_thread_.sink().GetUniqueMessageMatching( | 1224 message = render_thread_.sink().GetUniqueMessageMatching( |
| 1224 ViewHostMsg_PageContents::ID); | 1225 ViewHostMsg_PageContents::ID); |
| 1225 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); | 1226 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); |
| 1226 ViewHostMsg_PageContents::Read(message, ¶ms); | 1227 ViewHostMsg_PageContents::Read(message, ¶ms); |
| 1227 EXPECT_EQ("fr", params.d); | 1228 EXPECT_EQ("fr", params.d); |
| 1228 } | 1229 } |
| OLD | NEW |