OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/browser/renderer_host/render_process_host_impl.h" | 9 #include "content/browser/renderer_host/render_process_host_impl.h" |
10 #include "content/common/child_process_messages.h" | 10 #include "content/common/child_process_messages.h" |
11 #include "content/public/browser/render_frame_host.h" | 11 #include "content/public/browser/render_frame_host.h" |
12 #include "content/public/browser/render_process_host.h" | 12 #include "content/public/browser/render_process_host.h" |
13 #include "content/public/browser/render_process_host_observer.h" | 13 #include "content/public/browser/render_process_host_observer.h" |
14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "content/public/common/content_switches.h" |
15 #include "content/public/common/url_constants.h" | 16 #include "content/public/common/url_constants.h" |
16 #include "content/public/test/content_browser_test.h" | 17 #include "content/public/test/content_browser_test.h" |
17 #include "content/public/test/content_browser_test_utils.h" | 18 #include "content/public/test/content_browser_test_utils.h" |
18 #include "content/public/test/test_service.mojom.h" | 19 #include "content/public/test/test_service.mojom.h" |
19 #include "content/shell/browser/shell.h" | 20 #include "content/shell/browser/shell.h" |
20 #include "media/base/bind_to_current_loop.h" | 21 #include "media/base/bind_to_current_loop.h" |
21 #include "media/base/media_switches.h" | |
22 #include "media/base/test_data_util.h" | 22 #include "media/base/test_data_util.h" |
23 #include "net/test/embedded_test_server/embedded_test_server.h" | 23 #include "net/test/embedded_test_server/embedded_test_server.h" |
24 #include "services/service_manager/public/cpp/interface_provider.h" | 24 #include "services/service_manager/public/cpp/interface_provider.h" |
25 #include "services/service_manager/public/cpp/interface_registry.h" | 25 #include "services/service_manager/public/cpp/interface_registry.h" |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 #include "base/win/windows_version.h" | 28 #include "base/win/windows_version.h" |
29 #endif | 29 #endif |
30 | 30 |
31 namespace content { | 31 namespace content { |
(...skipping 10 matching lines...) Expand all Loading... |
42 } | 42 } |
43 return count; | 43 return count; |
44 } | 44 } |
45 | 45 |
46 class RenderProcessHostTest : public ContentBrowserTest, | 46 class RenderProcessHostTest : public ContentBrowserTest, |
47 public RenderProcessHostObserver { | 47 public RenderProcessHostObserver { |
48 public: | 48 public: |
49 RenderProcessHostTest() : process_exits_(0), host_destructions_(0) {} | 49 RenderProcessHostTest() : process_exits_(0), host_destructions_(0) {} |
50 | 50 |
51 void SetUpCommandLine(base::CommandLine* command_line) override { | 51 void SetUpCommandLine(base::CommandLine* command_line) override { |
52 command_line->AppendSwitch(switches::kIgnoreAutoplayRestrictionsForTests); | 52 command_line->AppendSwitch( |
| 53 switches::kDisableGestureRequirementForMediaPlayback); |
53 } | 54 } |
54 | 55 |
55 protected: | 56 protected: |
56 void set_process_exit_callback(const base::Closure& callback) { | 57 void set_process_exit_callback(const base::Closure& callback) { |
57 process_exit_callback_ = callback; | 58 process_exit_callback_ = callback; |
58 } | 59 } |
59 | 60 |
60 // RenderProcessHostObserver: | 61 // RenderProcessHostObserver: |
61 void RenderProcessExited(RenderProcessHost* host, | 62 void RenderProcessExited(RenderProcessHost* host, |
62 base::TerminationStatus status, | 63 base::TerminationStatus status, |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // Verify shutdown went as expected. | 324 // Verify shutdown went as expected. |
324 EXPECT_EQ(0, rph->get_audio_stream_count_for_testing()); | 325 EXPECT_EQ(0, rph->get_audio_stream_count_for_testing()); |
325 EXPECT_EQ(1, process_exits_); | 326 EXPECT_EQ(1, process_exits_); |
326 EXPECT_EQ(0, host_destructions_); | 327 EXPECT_EQ(0, host_destructions_); |
327 if (!host_destructions_) | 328 if (!host_destructions_) |
328 rph->RemoveObserver(this); | 329 rph->RemoveObserver(this); |
329 } | 330 } |
330 | 331 |
331 } // namespace | 332 } // namespace |
332 } // namespace content | 333 } // namespace content |
OLD | NEW |