OLD | NEW |
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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 EXPECT_TRUE(controller.CanGoBack()); | 876 EXPECT_TRUE(controller.CanGoBack()); |
877 EXPECT_FALSE(controller.CanGoForward()); | 877 EXPECT_FALSE(controller.CanGoForward()); |
878 } | 878 } |
879 | 879 |
880 // Verify that hiding a parent of the renderer will hide the content too. | 880 // Verify that hiding a parent of the renderer will hide the content too. |
881 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, HideContentOnParenHide) { | 881 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, HideContentOnParenHide) { |
882 ASSERT_NO_FATAL_FAILURE(StartTestWithPage("files/title1.html")); | 882 ASSERT_NO_FATAL_FAILURE(StartTestWithPage("files/title1.html")); |
883 WebContentsImpl* web_contents = | 883 WebContentsImpl* web_contents = |
884 static_cast<WebContentsImpl*>(shell()->web_contents()); | 884 static_cast<WebContentsImpl*>(shell()->web_contents()); |
885 aura::Window* content = web_contents->GetNativeView()->parent(); | 885 aura::Window* content = web_contents->GetNativeView()->parent(); |
886 EXPECT_TRUE(web_contents->should_normally_be_visible()); | 886 EXPECT_TRUE(web_contents->IsHiddenIgnoringCapturing()); |
887 content->Hide(); | 887 content->Hide(); |
888 EXPECT_FALSE(web_contents->should_normally_be_visible()); | 888 EXPECT_FALSE(web_contents->IsHiddenIgnoringCapturing()); |
889 content->Show(); | 889 content->Show(); |
890 EXPECT_TRUE(web_contents->should_normally_be_visible()); | 890 EXPECT_TRUE(web_contents->IsHiddenIgnoringCapturing()); |
891 } | 891 } |
892 | 892 |
893 // Ensure that SnapToPhysicalPixelBoundary() is called on WebContentsView parent | 893 // Ensure that SnapToPhysicalPixelBoundary() is called on WebContentsView parent |
894 // change. This is a regression test for http://crbug.com/388908. | 894 // change. This is a regression test for http://crbug.com/388908. |
895 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, WebContentsViewReparent) { | 895 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, WebContentsViewReparent) { |
896 ASSERT_NO_FATAL_FAILURE( | 896 ASSERT_NO_FATAL_FAILURE( |
897 StartTestWithPage("files/overscroll_navigation.html")); | 897 StartTestWithPage("files/overscroll_navigation.html")); |
898 | 898 |
899 scoped_ptr<aura::Window> window(new aura::Window(NULL)); | 899 scoped_ptr<aura::Window> window(new aura::Window(NULL)); |
900 window->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 900 window->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 details = dispatcher->OnEventFromSource(&release); | 1147 details = dispatcher->OnEventFromSource(&release); |
1148 ASSERT_FALSE(details.dispatcher_destroyed); | 1148 ASSERT_FALSE(details.dispatcher_destroyed); |
1149 WaitAFrame(); | 1149 WaitAFrame(); |
1150 | 1150 |
1151 EXPECT_LT(0, tracker.num_overscroll_updates()); | 1151 EXPECT_LT(0, tracker.num_overscroll_updates()); |
1152 EXPECT_FALSE(tracker.overscroll_completed()); | 1152 EXPECT_FALSE(tracker.overscroll_completed()); |
1153 } | 1153 } |
1154 } | 1154 } |
1155 | 1155 |
1156 } // namespace content | 1156 } // namespace content |
OLD | NEW |