OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/run_loop.h" |
| 15 #include "base/single_thread_task_runner.h" |
14 #include "build/build_config.h" | 16 #include "build/build_config.h" |
15 #include "cc/surfaces/surface.h" | 17 #include "cc/surfaces/surface.h" |
16 #include "cc/surfaces/surface_factory.h" | 18 #include "cc/surfaces/surface_factory.h" |
17 #include "cc/surfaces/surface_manager.h" | 19 #include "cc/surfaces/surface_manager.h" |
18 #include "cc/surfaces/surface_sequence.h" | 20 #include "cc/surfaces/surface_sequence.h" |
19 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" | 21 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" |
20 #include "content/browser/frame_host/cross_process_frame_connector.h" | 22 #include "content/browser/frame_host/cross_process_frame_connector.h" |
21 #include "content/browser/gpu/compositor_util.h" | 23 #include "content/browser/gpu/compositor_util.h" |
22 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 24 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
23 #include "content/browser/renderer_host/render_widget_host_impl.h" | 25 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 94 } |
93 | 95 |
94 void TearDown() override { | 96 void TearDown() override { |
95 if (view_) | 97 if (view_) |
96 view_->Destroy(); | 98 view_->Destroy(); |
97 delete widget_host_; | 99 delete widget_host_; |
98 delete test_frame_connector_; | 100 delete test_frame_connector_; |
99 | 101 |
100 browser_context_.reset(); | 102 browser_context_.reset(); |
101 | 103 |
102 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 104 message_loop_.task_runner()->DeleteSoon(FROM_HERE, |
103 message_loop_.RunUntilIdle(); | 105 browser_context_.release()); |
| 106 base::RunLoop().RunUntilIdle(); |
104 #if !defined(OS_ANDROID) | 107 #if !defined(OS_ANDROID) |
105 ImageTransportFactory::Terminate(); | 108 ImageTransportFactory::Terminate(); |
106 #endif | 109 #endif |
107 } | 110 } |
108 | 111 |
109 cc::SurfaceId surface_id() { return view_->surface_id_; } | 112 cc::SurfaceId surface_id() { return view_->surface_id_; } |
110 | 113 |
111 protected: | 114 protected: |
112 base::MessageLoopForUI message_loop_; | 115 base::MessageLoopForUI message_loop_; |
113 std::unique_ptr<BrowserContext> browser_context_; | 116 std::unique_ptr<BrowserContext> browser_context_; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 174 |
172 // Surface ID should have been passed to CrossProcessFrameConnector to | 175 // Surface ID should have been passed to CrossProcessFrameConnector to |
173 // be sent to the embedding renderer. | 176 // be sent to the embedding renderer. |
174 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); | 177 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); |
175 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); | 178 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); |
176 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); | 179 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); |
177 } | 180 } |
178 } | 181 } |
179 | 182 |
180 } // namespace content | 183 } // namespace content |
OLD | NEW |