| 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/path_service.h" | 5 #include "base/path_service.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "content/public/browser/render_view_host.h" | 7 #include "content/public/browser/render_view_host.h" |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 #include "content/public/common/content_paths.h" | 9 #include "content/public/common/content_paths.h" |
| 10 #include "content/shell/browser/shell.h" | 10 #include "content/shell/browser/shell.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 *snapshot_valid = true; | 42 *snapshot_valid = true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 base::FilePath test_dir_; | 46 base::FilePath test_dir_; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // Disabled on Windows and CrOS because it is flaky: crbug.com/272379. | |
| 50 // Disabled on Ozone due to flake: crbug.com/315392. | 49 // Disabled on Ozone due to flake: crbug.com/315392. |
| 51 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(USE_OZONE) | 50 // Disabled on Aura since this is not possible with ubercomp. |
| 51 #if defined(USE_AURA) || defined(USE_OZONE) |
| 52 #define MAYBE_GetSnapshotFromRendererTest DISABLED_GetSnapshotFromRendererTest | 52 #define MAYBE_GetSnapshotFromRendererTest DISABLED_GetSnapshotFromRendererTest |
| 53 #else | 53 #else |
| 54 #define MAYBE_GetSnapshotFromRendererTest GetSnapshotFromRendererTest | 54 #define MAYBE_GetSnapshotFromRendererTest GetSnapshotFromRendererTest |
| 55 #endif | 55 #endif |
| 56 IN_PROC_BROWSER_TEST_F(RenderWidgetHostBrowserTest, | 56 IN_PROC_BROWSER_TEST_F(RenderWidgetHostBrowserTest, |
| 57 MAYBE_GetSnapshotFromRendererTest) { | 57 MAYBE_GetSnapshotFromRendererTest) { |
| 58 base::RunLoop run_loop; | 58 base::RunLoop run_loop; |
| 59 | 59 |
| 60 NavigateToURL(shell(), GURL(net::FilePathToFileURL( | 60 NavigateToURL(shell(), GURL(net::FilePathToFileURL( |
| 61 test_dir_.AppendASCII("rwh_simple.html")))); | 61 test_dir_.AppendASCII("rwh_simple.html")))); |
| 62 | 62 |
| 63 bool snapshot_valid = false; | 63 bool snapshot_valid = false; |
| 64 RenderViewHost* const rwh = shell()->web_contents()->GetRenderViewHost(); | 64 RenderViewHost* const rwh = shell()->web_contents()->GetRenderViewHost(); |
| 65 rwh->GetSnapshotFromRenderer(gfx::Rect(), base::Bind( | 65 rwh->GetSnapshotFromRenderer(gfx::Rect(), base::Bind( |
| 66 &RenderWidgetHostBrowserTest::GetSnapshotFromRendererCallback, | 66 &RenderWidgetHostBrowserTest::GetSnapshotFromRendererCallback, |
| 67 base::Unretained(this), | 67 base::Unretained(this), |
| 68 run_loop.QuitClosure(), | 68 run_loop.QuitClosure(), |
| 69 &snapshot_valid)); | 69 &snapshot_valid)); |
| 70 run_loop.Run(); | 70 run_loop.Run(); |
| 71 | 71 |
| 72 EXPECT_EQ(snapshot_valid, true); | 72 EXPECT_EQ(snapshot_valid, true); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace content | 75 } // namespace content |
| OLD | NEW |