OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/browser_plugin/browser_plugin_browsertest.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_browsertest.h" |
6 | 6 |
7 #include "base/debug/leak_annotations.h" | 7 #include "base/debug/leak_annotations.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 return true; | 160 return true; |
161 } | 161 } |
162 | 162 |
163 MockBrowserPlugin* BrowserPluginTest::GetCurrentPlugin() { | 163 MockBrowserPlugin* BrowserPluginTest::GetCurrentPlugin() { |
164 BrowserPluginHostMsg_Attach_Params params; | 164 BrowserPluginHostMsg_Attach_Params params; |
165 return GetCurrentPluginWithAttachParams(¶ms); | 165 return GetCurrentPluginWithAttachParams(¶ms); |
166 } | 166 } |
167 | 167 |
168 MockBrowserPlugin* BrowserPluginTest::GetCurrentPluginWithAttachParams( | 168 MockBrowserPlugin* BrowserPluginTest::GetCurrentPluginWithAttachParams( |
169 BrowserPluginHostMsg_Attach_Params* params) { | 169 BrowserPluginHostMsg_Attach_Params* params) { |
| 170 // Make sure the BrowserPluginHostMsg_Attach IPC message is handled before |
| 171 // proceeding any further. |
| 172 ProcessPendingMessages(); |
| 173 |
170 int instance_id = 0; | 174 int instance_id = 0; |
171 const IPC::Message* msg = | 175 const IPC::Message* msg = |
172 browser_plugin_manager()->sink().GetUniqueMessageMatching( | 176 browser_plugin_manager()->sink().GetUniqueMessageMatching( |
173 BrowserPluginHostMsg_Attach::ID); | 177 BrowserPluginHostMsg_Attach::ID); |
174 if (!msg) | 178 if (!msg) |
175 return NULL; | 179 return NULL; |
176 | 180 |
177 PickleIterator iter(*msg); | 181 PickleIterator iter(*msg); |
178 if (!iter.ReadInt(&instance_id)) | 182 if (!iter.ReadInt(&instance_id)) |
179 return NULL; | 183 return NULL; |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 // These value are not populated (as an optimization) if autosize is | 591 // These value are not populated (as an optimization) if autosize is |
588 // disabled. | 592 // disabled. |
589 EXPECT_EQ(0, auto_size_params.min_size.width()); | 593 EXPECT_EQ(0, auto_size_params.min_size.width()); |
590 EXPECT_EQ(0, auto_size_params.min_size.height()); | 594 EXPECT_EQ(0, auto_size_params.min_size.height()); |
591 EXPECT_EQ(0, auto_size_params.max_size.width()); | 595 EXPECT_EQ(0, auto_size_params.max_size.width()); |
592 EXPECT_EQ(0, auto_size_params.max_size.height()); | 596 EXPECT_EQ(0, auto_size_params.max_size.height()); |
593 } | 597 } |
594 } | 598 } |
595 | 599 |
596 } // namespace content | 600 } // namespace content |
OLD | NEW |