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

Unified Diff: components/visitedlink/test/visitedlink_unittest.cc

Issue 1713473002: Make TestRenderWidgetHostView::Show/Hide call through to RWHI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@crash
Patch Set: Tentatively undo render_widget_host_view_base.cc modification Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/visitedlink/test/visitedlink_unittest.cc
diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc
index d53c5a4db908611ba1b660d3766306d6db0fc1f4..e5f61eebf8334e68dbd3b85e400cf63c133e0f06 100644
--- a/components/visitedlink/test/visitedlink_unittest.cc
+++ b/components/visitedlink/test/visitedlink_unittest.cc
@@ -30,6 +30,8 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread_bundle.h"
@@ -787,7 +789,7 @@ TEST_F(VisitedLinkEventsTest, TabVisibility) {
EXPECT_EQ(1, context()->reset_event_count());
// Simulate tab becoming inactive.
- RenderViewHostTester::For(rvh())->SimulateWasHidden();
+ web_contents()->GetRenderWidgetHostView()->Hide();
// Add a few URLs.
master()->AddURL(GURL("http://acidtests.org/"));
@@ -802,7 +804,7 @@ TEST_F(VisitedLinkEventsTest, TabVisibility) {
EXPECT_EQ(1, context()->reset_event_count());
// Simulate the tab becoming active.
- RenderViewHostTester::For(rvh())->SimulateWasShown();
+ web_contents()->GetRenderWidgetHostView()->Show();
context()->WaitForUpdate();
// We should now have 3 add events, still no reset events.
@@ -810,7 +812,7 @@ TEST_F(VisitedLinkEventsTest, TabVisibility) {
EXPECT_EQ(1, context()->reset_event_count());
// Deactivate the tab again.
- RenderViewHostTester::For(rvh())->SimulateWasHidden();
+ web_contents()->GetRenderWidgetHostView()->Hide();
// Add a bunch of URLs (over 50) to exhaust the link event buffer.
for (int i = 0; i < 100; i++)
@@ -825,7 +827,7 @@ TEST_F(VisitedLinkEventsTest, TabVisibility) {
EXPECT_EQ(1, context()->reset_event_count());
// Activate the tab.
- RenderViewHostTester::For(rvh())->SimulateWasShown();
+ web_contents()->GetRenderWidgetHostView()->Show();
EXPECT_FALSE(timer_->IsRunning());
context()->WaitForUpdate();

Powered by Google App Engine
This is Rietveld 408576698