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

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 2684993011: Revert of Make TestRenderWidgetHostView::Show/Hide call through to RWHI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@crash
Patch Set: 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
« no previous file with comments | « components/visitedlink/test/visitedlink_unittest.cc ('k') | content/public/test/test_renderer_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 011be070c233414281996b07d2443a9e14d8156d..53a86d7cd7902c39816404fbd63203f49f0c0da2 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -162,7 +162,7 @@
bool is_showing() const {
return static_cast<TestRenderWidgetHostView*>(
GetMainFrame()->GetRenderViewHost()->GetWidget()->GetView())
- ->IsShowing();
+ ->is_showing();
}
void ClearStates() {
@@ -1684,6 +1684,7 @@
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
// The interstitial should not show until its navigation has committed.
+ EXPECT_FALSE(interstitial->is_showing());
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
@@ -1731,6 +1732,7 @@
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
// The interstitial should not show until its navigation has committed.
+ EXPECT_FALSE(interstitial->is_showing());
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
@@ -1775,6 +1777,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
// The interstitial should not show until its navigation has committed.
+ EXPECT_FALSE(interstitial->is_showing());
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
@@ -1826,6 +1829,7 @@
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
// The interstitial should not show until its navigation has committed.
+ EXPECT_FALSE(interstitial->is_showing());
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
@@ -1885,6 +1889,7 @@
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
// The interstitial should not show until its navigation has committed.
+ EXPECT_FALSE(interstitial->is_showing());
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
@@ -1941,6 +1946,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
// The interstitial should not show until its navigation has committed.
+ EXPECT_FALSE(interstitial->is_showing());
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
@@ -2325,7 +2331,7 @@
const GURL url("http://www.google.com");
controller().LoadURL(
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
- EXPECT_FALSE(contents()->ShowingInterstitialPage());
+ EXPECT_FALSE(interstitial->is_showing());
RunAllPendingInMessageLoop();
ASSERT_FALSE(deleted);
@@ -2697,20 +2703,22 @@
// With no capturers, setting and un-setting occlusion should change the
// view's occlusion state.
- EXPECT_TRUE(view->IsShowing());
+ EXPECT_FALSE(view->is_showing());
+ contents()->WasShown();
+ EXPECT_TRUE(view->is_showing());
contents()->WasHidden();
- EXPECT_FALSE(view->IsShowing());
+ EXPECT_FALSE(view->is_showing());
contents()->WasShown();
- EXPECT_TRUE(view->IsShowing());
+ EXPECT_TRUE(view->is_showing());
// Add a capturer and try to hide the contents. The view will remain visible.
contents()->IncrementCapturerCount(gfx::Size());
contents()->WasHidden();
- EXPECT_TRUE(view->IsShowing());
+ EXPECT_TRUE(view->is_showing());
// Remove the capturer, and the WasHidden should take effect.
contents()->DecrementCapturerCount();
- EXPECT_FALSE(view->IsShowing());
+ EXPECT_FALSE(view->is_showing());
}
TEST_F(WebContentsImplTest, CapturerPreventsOcclusion) {
« no previous file with comments | « components/visitedlink/test/visitedlink_unittest.cc ('k') | content/public/test/test_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698