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

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

Issue 1495923002: Prevent reported RenderViewImplTest LSan leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | 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 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 ExecuteJavaScriptForTests( 472 ExecuteJavaScriptForTests(
473 "document.getElementById('elt_text').value = 'foo';"); 473 "document.getElementById('elt_text').value = 'foo';");
474 ProcessPendingMessages(); 474 ProcessPendingMessages();
475 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { 475 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
476 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( 476 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(
477 FrameHostMsg_UpdateState::ID)); 477 FrameHostMsg_UpdateState::ID));
478 } else { 478 } else {
479 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( 479 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(
480 ViewHostMsg_UpdateState::ID)); 480 ViewHostMsg_UpdateState::ID));
481 } 481 }
482 ProcessPendingMessages();
482 } 483 }
483 484
484 TEST_F(RenderViewImplTest, OnNavigationHttpPost) { 485 TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
485 // An http url will trigger a resource load so cannot be used here. 486 // An http url will trigger a resource load so cannot be used here.
486 CommonNavigationParams common_params; 487 CommonNavigationParams common_params;
487 StartNavigationParams start_params; 488 StartNavigationParams start_params;
488 RequestNavigationParams request_params; 489 RequestNavigationParams request_params;
489 common_params.url = GURL("data:text/html,<div>Page</div>"); 490 common_params.url = GURL("data:text/html,<div>Page</div>");
490 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; 491 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
491 common_params.transition = ui::PAGE_TRANSITION_TYPED; 492 common_params.transition = ui::PAGE_TRANSITION_TYPED;
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 // Move the input focus to the target <input> element, where we should 1066 // Move the input focus to the target <input> element, where we should
1066 // activate IMEs. 1067 // activate IMEs.
1067 ExecuteJavaScriptAndReturnIntValue(base::ASCIIToUTF16(javascript), NULL); 1068 ExecuteJavaScriptAndReturnIntValue(base::ASCIIToUTF16(javascript), NULL);
1068 ProcessPendingMessages(); 1069 ProcessPendingMessages();
1069 render_thread_->sink().ClearMessages(); 1070 render_thread_->sink().ClearMessages();
1070 1071
1071 // Update the IME status and verify if our IME backend sends an IPC 1072 // Update the IME status and verify if our IME backend sends an IPC
1072 // message to activate IMEs. 1073 // message to activate IMEs.
1073 view()->UpdateTextInputState( 1074 view()->UpdateTextInputState(
1074 RenderWidget::NO_SHOW_IME, RenderWidget::FROM_NON_IME); 1075 RenderWidget::NO_SHOW_IME, RenderWidget::FROM_NON_IME);
1076 ProcessPendingMessages();
1075 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0); 1077 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0);
1076 EXPECT_TRUE(msg != NULL); 1078 EXPECT_TRUE(msg != NULL);
1077 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); 1079 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type());
1078 ViewHostMsg_TextInputStateChanged::Read(msg, &params); 1080 ViewHostMsg_TextInputStateChanged::Read(msg, &params);
1079 p = base::get<0>(params); 1081 p = base::get<0>(params);
1080 type = p.type; 1082 type = p.type;
1081 input_mode = p.mode; 1083 input_mode = p.mode;
1082 EXPECT_EQ(test_case->expected_mode, input_mode); 1084 EXPECT_EQ(test_case->expected_mode, input_mode);
1083 } 1085 }
1084 } 1086 }
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 FROM_HERE, 2484 FROM_HERE,
2483 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); 2485 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this)));
2484 ExecuteJavaScriptForTests("debugger;"); 2486 ExecuteJavaScriptForTests("debugger;");
2485 2487
2486 // CloseWhilePaused should resume execution and continue here. 2488 // CloseWhilePaused should resume execution and continue here.
2487 EXPECT_FALSE(IsPaused()); 2489 EXPECT_FALSE(IsPaused());
2488 Detach(); 2490 Detach();
2489 } 2491 }
2490 2492
2491 } // namespace content 2493 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698