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

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

Issue 11193051: To fix the cross-site post submission bug. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android API, Helper Function and Include_rules Created 8 years 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/browser/page_navigator.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/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/intents_messages.h" 10 #include "content/common/intents_messages.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 ViewMsg_Navigate_Params nav_params; 301 ViewMsg_Navigate_Params nav_params;
302 302
303 // An http url will trigger a resource load so cannot be used here. 303 // An http url will trigger a resource load so cannot be used here.
304 nav_params.url = GURL("data:text/html,<div>Page</div>"); 304 nav_params.url = GURL("data:text/html,<div>Page</div>");
305 nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL; 305 nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
306 nav_params.transition = PAGE_TRANSITION_TYPED; 306 nav_params.transition = PAGE_TRANSITION_TYPED;
307 nav_params.page_id = -1; 307 nav_params.page_id = -1;
308 nav_params.is_post = true; 308 nav_params.is_post = true;
309 309
310 // Set up post data. 310 // Set up post data.
311 const unsigned char* raw_data = reinterpret_cast<const unsigned char*>( 311 const char* raw_data = "post \0\ndata";
312 "post \0\ndata");
313 const unsigned int length = 11; 312 const unsigned int length = 11;
314 const std::vector<unsigned char> post_data(raw_data, raw_data + length); 313 scoped_refptr<webkit_glue::ResourceRequestBody> post_data =
314 new webkit_glue::ResourceRequestBody();
315 post_data->AppendBytes(raw_data, length);
315 nav_params.browser_initiated_post_data = post_data; 316 nav_params.browser_initiated_post_data = post_data;
316 317
317 view()->OnNavigate(nav_params); 318 view()->OnNavigate(nav_params);
318 ProcessPendingMessages(); 319 ProcessPendingMessages();
319 320
320 const IPC::Message* frame_navigate_msg = 321 const IPC::Message* frame_navigate_msg =
321 render_thread_->sink().GetUniqueMessageMatching( 322 render_thread_->sink().GetUniqueMessageMatching(
322 ViewHostMsg_FrameNavigate::ID); 323 ViewHostMsg_FrameNavigate::ID);
323 EXPECT_TRUE(frame_navigate_msg); 324 EXPECT_TRUE(frame_navigate_msg);
324 325
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 EXPECT_EQ(7, info.selectionEnd); 1785 EXPECT_EQ(7, info.selectionEnd);
1785 view()->OnSetEditableSelectionOffsets(4, 8); 1786 view()->OnSetEditableSelectionOffsets(4, 8);
1786 view()->OnExtendSelectionAndDelete(2, 5); 1787 view()->OnExtendSelectionAndDelete(2, 5);
1787 info = view()->webview()->textInputInfo(); 1788 info = view()->webview()->textInputInfo();
1788 EXPECT_EQ("abuvwxyz", info.value); 1789 EXPECT_EQ("abuvwxyz", info.value);
1789 EXPECT_EQ(2, info.selectionStart); 1790 EXPECT_EQ(2, info.selectionStart);
1790 EXPECT_EQ(2, info.selectionEnd); 1791 EXPECT_EQ(2, info.selectionEnd);
1791 } 1792 }
1792 1793
1793 } // namespace content 1794 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/page_navigator.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698