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" |
11 #include "content/test/content_browser_test.h" | 11 #include "content/test/content_browser_test.h" |
12 #include "content/test/content_browser_test_utils.h" | 12 #include "content/test/content_browser_test_utils.h" |
13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 class RenderWidgetHostBrowserTest : public ContentBrowserTest { | 18 class RenderWidgetHostBrowserTest : public ContentBrowserTest { |
19 public: | 19 public: |
20 RenderWidgetHostBrowserTest() {} | 20 RenderWidgetHostBrowserTest() {} |
21 | 21 |
22 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 22 virtual void SetUpOnMainThread() OVERRIDE { |
23 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir_)); | 23 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir_)); |
24 } | 24 } |
25 | 25 |
26 void GetSnapshotFromRendererCallback(const base::Closure& quit_closure, | 26 void GetSnapshotFromRendererCallback(const base::Closure& quit_closure, |
27 bool* snapshot_valid, | 27 bool* snapshot_valid, |
28 bool success, | 28 bool success, |
29 const SkBitmap& bitmap) { | 29 const SkBitmap& bitmap) { |
30 quit_closure.Run(); | 30 quit_closure.Run(); |
31 EXPECT_EQ(success, true); | 31 EXPECT_EQ(success, true); |
32 | 32 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |