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" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include "base/win/windows_version.h" | 13 #include "base/win/windows_version.h" |
14 #endif | 14 #endif |
15 #include "content/browser/frame_host/navigation_controller_impl.h" | 15 #include "content/browser/frame_host/navigation_controller_impl.h" |
16 #include "content/browser/frame_host/navigation_entry_impl.h" | 16 #include "content/browser/frame_host/navigation_entry_impl.h" |
17 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h" | 17 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h" |
18 #include "content/browser/web_contents/web_contents_impl.h" | 18 #include "content/browser/web_contents/web_contents_impl.h" |
19 #include "content/browser/web_contents/web_contents_view.h" | 19 #include "content/browser/web_contents/web_contents_view.h" |
20 #include "content/common/view_messages.h" | 20 #include "content/common/view_messages.h" |
21 #include "content/public/browser/render_frame_host.h" | 21 #include "content/public/browser/render_frame_host.h" |
22 #include "content/public/browser/web_contents_observer.h" | 22 #include "content/public/browser/web_contents_observer.h" |
23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
24 #include "content/public/test/browser_test_utils.h" | 24 #include "content/public/test/browser_test_utils.h" |
25 #include "content/public/test/content_browser_test.h" | 25 #include "content/public/test/content_browser_test.h" |
26 #include "content/public/test/content_browser_test_utils.h" | 26 #include "content/public/test/content_browser_test_utils.h" |
27 #include "content/public/test/test_renderer_host.h" | 27 #include "content/public/test/test_renderer_host.h" |
28 #include "content/public/test/test_utils.h" | 28 #include "content/public/test/test_utils.h" |
29 #include "content/shell/browser/shell.h" | 29 #include "content/shell/browser/shell.h" |
30 #include "ui/aura/client/aura_constants.h" | |
30 #include "ui/aura/test/event_generator.h" | 31 #include "ui/aura/test/event_generator.h" |
31 #include "ui/aura/window.h" | 32 #include "ui/aura/window.h" |
32 #include "ui/aura/window_tree_host.h" | 33 #include "ui/aura/window_tree_host.h" |
33 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 34 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
34 #include "ui/events/event_processor.h" | 35 #include "ui/events/event_processor.h" |
35 #include "ui/events/event_utils.h" | 36 #include "ui/events/event_utils.h" |
36 | 37 |
37 namespace content { | 38 namespace content { |
38 | 39 |
39 // This class keeps track of the RenderViewHost whose screenshot was captured. | 40 // This class keeps track of the RenderViewHost whose screenshot was captured. |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
680 WebContentsImpl* web_contents = | 681 WebContentsImpl* web_contents = |
681 static_cast<WebContentsImpl*>(shell()->web_contents()); | 682 static_cast<WebContentsImpl*>(shell()->web_contents()); |
682 aura::Window* content = web_contents->GetNativeView()->parent(); | 683 aura::Window* content = web_contents->GetNativeView()->parent(); |
683 EXPECT_TRUE(web_contents->should_normally_be_visible()); | 684 EXPECT_TRUE(web_contents->should_normally_be_visible()); |
684 content->Hide(); | 685 content->Hide(); |
685 EXPECT_FALSE(web_contents->should_normally_be_visible()); | 686 EXPECT_FALSE(web_contents->should_normally_be_visible()); |
686 content->Show(); | 687 content->Show(); |
687 EXPECT_TRUE(web_contents->should_normally_be_visible()); | 688 EXPECT_TRUE(web_contents->should_normally_be_visible()); |
688 } | 689 } |
689 | 690 |
691 // Verify that hiding a parent of the renderer will hide the content too. | |
sky
2014/06/20 15:10:37
I don't think this test provides much value, go ah
| |
692 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, HostWindowKey) { | |
693 ASSERT_NO_FATAL_FAILURE(StartTestWithPage("files/title1.html")); | |
694 WebContentsImpl* web_contents = | |
695 static_cast<WebContentsImpl*>(shell()->web_contents()); | |
696 | |
697 EXPECT_EQ(shell()->window(), | |
698 web_contents->GetNativeView()->GetProperty( | |
699 aura::client::kHostWindowKey)); | |
700 } | |
701 | |
690 } // namespace content | 702 } // namespace content |
OLD | NEW |