OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/port/browser/render_widget_host_view_port.h" | 8 #include "content/port/browser/render_widget_host_view_port.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "content/public/common/content_paths.h" | 11 #include "content/public/common/content_paths.h" |
12 #include "content/shell/shell.h" | 12 #include "content/shell/shell.h" |
13 #include "content/test/content_browser_test.h" | 13 #include "content/test/content_browser_test.h" |
14 #include "content/test/content_browser_test_utils.h" | 14 #include "content/test/content_browser_test_utils.h" |
15 #include "net/base/net_util.h" | 15 #include "net/base/net_util.h" |
16 #include "skia/ext/platform_canvas.h" | 16 #include "skia/ext/platform_canvas.h" |
17 #include "ui/compositor/compositor_setup.h" | 17 #include "ui/compositor/compositor_setup.h" |
18 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) |
19 #include "ui/surface/io_surface_support_mac.h" | 19 #include "ui/surface/io_surface_support_mac.h" |
20 #endif | 20 #endif |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 class RenderWidgetHostViewBrowserTest : public ContentBrowserTest { | 24 class RenderWidgetHostViewBrowserTest : public ContentBrowserTest { |
25 public: | 25 public: |
26 RenderWidgetHostViewBrowserTest() : finish_called_(false), size_(400, 300) {} | 26 RenderWidgetHostViewBrowserTest() : finish_called_(false), size_(400, 300) {} |
27 | 27 |
28 virtual void SetUpInProcessBrowserTestFixture() { | 28 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
29 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir_)); | 29 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir_)); |
30 } | 30 } |
31 | 31 |
32 virtual void SetUpCommandLine(CommandLine* command_line) { | 32 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
33 ui::DisableTestCompositor(); | 33 ui::DisableTestCompositor(); |
34 } | 34 } |
35 | 35 |
36 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
37 void SetupCompositingSurface() { | 37 void SetupCompositingSurface() { |
38 NavigateToURL(shell(), net::FilePathToFileURL( | 38 NavigateToURL(shell(), net::FilePathToFileURL( |
39 test_dir_.AppendASCII("rwhv_compositing_static.html"))); | 39 test_dir_.AppendASCII("rwhv_compositing_static.html"))); |
40 | 40 |
41 RenderViewHost* const rwh = | 41 RenderViewHost* const rwh = |
42 shell()->web_contents()->GetRenderViewHost(); | 42 shell()->web_contents()->GetRenderViewHost(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 size_, | 121 size_, |
122 base::Bind(&RenderWidgetHostViewBrowserTest::FinishCopyFromBackingStore, | 122 base::Bind(&RenderWidgetHostViewBrowserTest::FinishCopyFromBackingStore, |
123 base::Unretained(this), true, run_loop.QuitClosure())); | 123 base::Unretained(this), true, run_loop.QuitClosure())); |
124 run_loop.Run(); | 124 run_loop.Run(); |
125 | 125 |
126 ASSERT_TRUE(finish_called_); | 126 ASSERT_TRUE(finish_called_); |
127 } | 127 } |
128 #endif | 128 #endif |
129 | 129 |
130 } // namespace content | 130 } // namespace content |
OLD | NEW |