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

Side by Side Diff: content/renderer/render_view_browsertest_mac.mm

Issue 10384128: Quote WebPreferences in namespace webkit_glue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright 2012 Created 8 years, 7 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 | « content/public/renderer/render_view.h ('k') | content/renderer/render_view_impl.h » ('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) 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/string_util.h" 5 #include "base/string_util.h"
6 #include "base/string16.h" 6 #include "base/string16.h"
7 #include "content/public/browser/native_web_keyboard_event.h" 7 #include "content/public/browser/native_web_keyboard_event.h"
8 #include "content/renderer/render_view_impl.h" 8 #include "content/renderer/render_view_impl.h"
9 #include "content/test/render_view_test.h" 9 #include "content/test/render_view_test.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 onkeydown='return OnKeyEvent(event);'> 76 onkeydown='return OnKeyEvent(event);'>
77 <div id='keydown' contenteditable='true'> </div> 77 <div id='keydown' contenteditable='true'> </div>
78 <div id='scroll' contenteditable='true'> </div> 78 <div id='scroll' contenteditable='true'> </div>
79 <p>p1 79 <p>p1
80 <p>p2 80 <p>p2
81 </body> 81 </body>
82 </html> 82 </html>
83 ); 83 );
84 #undef HTML 84 #undef HTML
85 85
86 WebPreferences prefs; 86 webkit_glue::WebPreferences prefs;
87 prefs.enable_scroll_animator = false; 87 prefs.enable_scroll_animator = false;
88 88
89 RenderViewImpl* view = static_cast<RenderViewImpl*>(view_); 89 RenderViewImpl* view = static_cast<RenderViewImpl*>(view_);
90 view->OnUpdateWebPreferences(prefs); 90 view->OnUpdateWebPreferences(prefs);
91 91
92 const int kMaxOutputCharacters = 1024; 92 const int kMaxOutputCharacters = 1024;
93 string16 output; 93 string16 output;
94 char htmlBuffer[2048]; 94 char htmlBuffer[2048];
95 95
96 NSEvent* arrowDownKeyDown = CmdDeadKeyEvent(NSKeyDown, kVK_DownArrow); 96 NSEvent* arrowDownKeyDown = CmdDeadKeyEvent(NSKeyDown, kVK_DownArrow);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const char* kArrowUpNoScroll = 139 const char* kArrowUpNoScroll =
140 "38,false,false,true,false\np1\n\np2"; 140 "38,false,false,true,false\np1\n\np2";
141 view->OnSetEditCommandsForNextKeyEvent( 141 view->OnSetEditCommandsForNextKeyEvent(
142 EditCommands(1, EditCommand("moveToBeginningOfDocument", ""))); 142 EditCommands(1, EditCommand("moveToBeginningOfDocument", "")));
143 SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown)); 143 SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown));
144 ProcessPendingMessages(); 144 ProcessPendingMessages();
145 output = GetMainFrame()->contentAsText(kMaxOutputCharacters); 145 output = GetMainFrame()->contentAsText(kMaxOutputCharacters);
146 EXPECT_EQ(kArrowUpNoScroll, UTF16ToASCII(output)); 146 EXPECT_EQ(kArrowUpNoScroll, UTF16ToASCII(output));
147 } 147 }
148 148
OLDNEW
« no previous file with comments | « content/public/renderer/render_view.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698