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/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 update_rect_params.damage_buffer_sequence_id = | 312 update_rect_params.damage_buffer_sequence_id = |
313 browser_plugin->damage_buffer_sequence_id_; | 313 browser_plugin->damage_buffer_sequence_id_; |
314 BrowserPluginMsg_UpdateRect msg(instance_id, update_rect_params); | 314 BrowserPluginMsg_UpdateRect msg(instance_id, update_rect_params); |
315 browser_plugin->OnMessageReceived(msg); | 315 browser_plugin->OnMessageReceived(msg); |
316 EXPECT_EQ(NULL, browser_plugin->pending_damage_buffer_.get()); | 316 EXPECT_EQ(NULL, browser_plugin->pending_damage_buffer_.get()); |
317 } | 317 } |
318 | 318 |
319 browser_plugin_manager()->sink().ClearMessages(); | 319 browser_plugin_manager()->sink().ClearMessages(); |
320 | 320 |
321 // Resize the browser plugin three times. | 321 // Resize the browser plugin three times. |
| 322 |
322 ExecuteJavaScript("document.getElementById('browserplugin').width = '641px'"); | 323 ExecuteJavaScript("document.getElementById('browserplugin').width = '641px'"); |
| 324 GetMainFrame()->view()->layout(); |
323 ProcessPendingMessages(); | 325 ProcessPendingMessages(); |
| 326 |
324 ExecuteJavaScript("document.getElementById('browserplugin').width = '642px'"); | 327 ExecuteJavaScript("document.getElementById('browserplugin').width = '642px'"); |
| 328 GetMainFrame()->view()->layout(); |
325 ProcessPendingMessages(); | 329 ProcessPendingMessages(); |
| 330 |
326 ExecuteJavaScript("document.getElementById('browserplugin').width = '643px'"); | 331 ExecuteJavaScript("document.getElementById('browserplugin').width = '643px'"); |
| 332 GetMainFrame()->view()->layout(); |
327 ProcessPendingMessages(); | 333 ProcessPendingMessages(); |
328 | 334 |
329 // Expect to see one resize messsage in the sink. BrowserPlugin will not issue | 335 // Expect to see one resize messsage in the sink. BrowserPlugin will not issue |
330 // subsequent resize requests until the first request is satisfied by the | 336 // subsequent resize requests until the first request is satisfied by the |
331 // guest. The rest of the messages could be | 337 // guest. The rest of the messages could be |
332 // BrowserPluginHostMsg_UpdateGeometry msgs. | 338 // BrowserPluginHostMsg_UpdateGeometry msgs. |
333 EXPECT_LE(1u, browser_plugin_manager()->sink().message_count()); | 339 EXPECT_LE(1u, browser_plugin_manager()->sink().message_count()); |
334 for (size_t i = 0; i < browser_plugin_manager()->sink().message_count(); | 340 for (size_t i = 0; i < browser_plugin_manager()->sink().message_count(); |
335 ++i) { | 341 ++i) { |
336 const IPC::Message* msg = browser_plugin_manager()->sink().GetMessageAt(i); | 342 const IPC::Message* msg = browser_plugin_manager()->sink().GetMessageAt(i); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 // These value are not populated (as an optimization) if autosize is | 630 // These value are not populated (as an optimization) if autosize is |
625 // disabled. | 631 // disabled. |
626 EXPECT_EQ(0, auto_size_params.min_size.width()); | 632 EXPECT_EQ(0, auto_size_params.min_size.width()); |
627 EXPECT_EQ(0, auto_size_params.min_size.height()); | 633 EXPECT_EQ(0, auto_size_params.min_size.height()); |
628 EXPECT_EQ(0, auto_size_params.max_size.width()); | 634 EXPECT_EQ(0, auto_size_params.max_size.width()); |
629 EXPECT_EQ(0, auto_size_params.max_size.height()); | 635 EXPECT_EQ(0, auto_size_params.max_size.height()); |
630 } | 636 } |
631 } | 637 } |
632 | 638 |
633 } // namespace content | 639 } // namespace content |
OLD | NEW |