Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Side by Side Diff: chrome/renderer/render_view_browsertest.cc

Issue 6186008: Linux: fix a bunch of NULL vs. 0 issues spotted by gcc 4.5. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/pepper_plugin_delegate_impl.cc ('k') | courgette/streams_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 int key_code = kKeyCodes[k]; 669 int key_code = kKeyCodes[k];
670 std::wstring char_code; 670 std::wstring char_code;
671 if (SendKeyEvent(layout, key_code, modifiers, &char_code) < 0) 671 if (SendKeyEvent(layout, key_code, modifiers, &char_code) < 0)
672 continue; 672 continue;
673 673
674 // Create an expected result from the virtual-key code, the character 674 // Create an expected result from the virtual-key code, the character
675 // code, and the modifier-key status. 675 // code, and the modifier-key status.
676 // We format a string that emulates a DOM-event string produced hy 676 // We format a string that emulates a DOM-event string produced hy
677 // our JavaScript function. (See the above comment for the format.) 677 // our JavaScript function. (See the above comment for the format.)
678 static char expected_result[1024]; 678 static char expected_result[1024];
679 expected_result[0] = NULL; 679 expected_result[0] = 0;
680 base::snprintf(&expected_result[0], 680 base::snprintf(&expected_result[0],
681 sizeof(expected_result), 681 sizeof(expected_result),
682 "\n" // texts in the <input> element 682 "\n" // texts in the <input> element
683 "%d,%s\n" // texts in the first <div> element 683 "%d,%s\n" // texts in the first <div> element
684 "%d,%s\n" // texts in the second <div> element 684 "%d,%s\n" // texts in the second <div> element
685 "%d,%s", // texts in the third <div> element 685 "%d,%s", // texts in the third <div> element
686 key_code, kModifierData[j].expected_result, 686 key_code, kModifierData[j].expected_result,
687 static_cast<int>(char_code[0]), 687 static_cast<int>(char_code[0]),
688 kModifierData[j].expected_result, 688 kModifierData[j].expected_result,
689 key_code, kModifierData[j].expected_result); 689 key_code, kModifierData[j].expected_result);
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 LoadHTML("<html><head><meta http-equiv=\"content-language\" " 1226 LoadHTML("<html><head><meta http-equiv=\"content-language\" "
1227 "content=\" fr , es,en \">" 1227 "content=\" fr , es,en \">"
1228 "</head><body>A random page with random content.</body></html>"); 1228 "</head><body>A random page with random content.</body></html>");
1229 ProcessPendingMessages(); 1229 ProcessPendingMessages();
1230 message = render_thread_.sink().GetUniqueMessageMatching( 1230 message = render_thread_.sink().GetUniqueMessageMatching(
1231 ViewHostMsg_PageContents::ID); 1231 ViewHostMsg_PageContents::ID);
1232 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); 1232 ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
1233 ViewHostMsg_PageContents::Read(message, &params); 1233 ViewHostMsg_PageContents::Read(message, &params);
1234 EXPECT_EQ("fr", params.d); 1234 EXPECT_EQ("fr", params.d);
1235 } 1235 }
OLDNEW
« no previous file with comments | « chrome/renderer/pepper_plugin_delegate_impl.cc ('k') | courgette/streams_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698