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/single_thread_task_runner.h" | |
14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
15 #include "cc/surfaces/surface.h" | 16 #include "cc/surfaces/surface.h" |
16 #include "cc/surfaces/surface_factory.h" | 17 #include "cc/surfaces/surface_factory.h" |
17 #include "cc/surfaces/surface_manager.h" | 18 #include "cc/surfaces/surface_manager.h" |
18 #include "cc/surfaces/surface_sequence.h" | 19 #include "cc/surfaces/surface_sequence.h" |
19 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " | 20 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " |
20 #include "content/browser/frame_host/cross_process_frame_connector.h" | 21 #include "content/browser/frame_host/cross_process_frame_connector.h" |
21 #include "content/browser/gpu/compositor_util.h" | 22 #include "content/browser/gpu/compositor_util.h" |
22 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 23 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
23 #include "content/browser/renderer_host/render_widget_host_impl.h" | 24 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 } | 93 } |
93 | 94 |
94 void TearDown() override { | 95 void TearDown() override { |
95 if (view_) | 96 if (view_) |
96 view_->Destroy(); | 97 view_->Destroy(); |
97 delete widget_host_; | 98 delete widget_host_; |
98 delete test_frame_connector_; | 99 delete test_frame_connector_; |
99 | 100 |
100 browser_context_.reset(); | 101 browser_context_.reset(); |
101 | 102 |
102 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 103 message_loop_.task_runner()->DeleteSoon(FROM_HERE, |
104 browser_context_.release()); | |
103 message_loop_.RunUntilIdle(); | 105 message_loop_.RunUntilIdle(); |
ncarter (slow)
2016/06/22 20:51:09
Should this be converted to base::RunLoop().RunUnt
fdoray
2016/06/28 20:40:35
Done.
| |
104 #if !defined(OS_ANDROID) | 106 #if !defined(OS_ANDROID) |
105 ImageTransportFactory::Terminate(); | 107 ImageTransportFactory::Terminate(); |
106 #endif | 108 #endif |
107 } | 109 } |
108 | 110 |
109 cc::SurfaceId surface_id() { return view_->surface_id_; } | 111 cc::SurfaceId surface_id() { return view_->surface_id_; } |
110 | 112 |
111 protected: | 113 protected: |
112 base::MessageLoopForUI message_loop_; | 114 base::MessageLoopForUI message_loop_; |
113 std::unique_ptr<BrowserContext> browser_context_; | 115 std::unique_ptr<BrowserContext> browser_context_; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 | 174 |
173 // Surface ID should have been passed to CrossProcessFrameConnector to | 175 // Surface ID should have been passed to CrossProcessFrameConnector to |
174 // be sent to the embedding renderer. | 176 // be sent to the embedding renderer. |
175 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); | 177 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); |
176 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); | 178 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); |
177 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); | 179 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); |
178 } | 180 } |
179 } | 181 } |
180 | 182 |
181 } // namespace content | 183 } // namespace content |
OLD | NEW |