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

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 FileRead Permission Created 8 years, 2 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
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 render_thread_->sink().ClearMessages(); 291 render_thread_->sink().ClearMessages();
292 292
293 // Change the value of the input. We should have gotten an update state 293 // Change the value of the input. We should have gotten an update state
294 // notification. We need to spin the message loop to catch this update. 294 // notification. We need to spin the message loop to catch this update.
295 ExecuteJavaScript("document.getElementById('elt_text').value = 'foo';"); 295 ExecuteJavaScript("document.getElementById('elt_text').value = 'foo';");
296 ProcessPendingMessages(); 296 ProcessPendingMessages();
297 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( 297 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(
298 ViewHostMsg_UpdateState::ID)); 298 ViewHostMsg_UpdateState::ID));
299 } 299 }
300 300
301 // Need to change the test for Cross-Site Process.
301 TEST_F(RenderViewImplTest, OnNavigationHttpPost) { 302 TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
302 ViewMsg_Navigate_Params nav_params; 303 ViewMsg_Navigate_Params nav_params;
303 304
304 // An http url will trigger a resource load so cannot be used here. 305 // An http url will trigger a resource load so cannot be used here.
305 nav_params.url = GURL("data:text/html,<div>Page</div>"); 306 nav_params.url = GURL("data:text/html,<div>Page</div>");
306 nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL; 307 nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
307 nav_params.transition = content::PAGE_TRANSITION_TYPED; 308 nav_params.transition = content::PAGE_TRANSITION_TYPED;
308 nav_params.page_id = -1; 309 nav_params.page_id = -1;
309 nav_params.is_post = true; 310 nav_params.is_post = true;
310 311
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 EXPECT_EQ("abcdefgopqrstuvwxyz", info.value); 1784 EXPECT_EQ("abcdefgopqrstuvwxyz", info.value);
1784 EXPECT_EQ(7, info.selectionStart); 1785 EXPECT_EQ(7, info.selectionStart);
1785 EXPECT_EQ(7, info.selectionEnd); 1786 EXPECT_EQ(7, info.selectionEnd);
1786 view()->OnSetEditableSelectionOffsets(4, 8); 1787 view()->OnSetEditableSelectionOffsets(4, 8);
1787 view()->OnExtendSelectionAndDelete(2, 5); 1788 view()->OnExtendSelectionAndDelete(2, 5);
1788 info = view()->webview()->textInputInfo(); 1789 info = view()->webview()->textInputInfo();
1789 EXPECT_EQ("abuvwxyz", info.value); 1790 EXPECT_EQ("abuvwxyz", info.value);
1790 EXPECT_EQ(2, info.selectionStart); 1791 EXPECT_EQ(2, info.selectionStart);
1791 EXPECT_EQ(2, info.selectionEnd); 1792 EXPECT_EQ(2, info.selectionEnd);
1792 } 1793 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698