Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_browsertest.cc

Issue 11360106: Browser Plugin: Implement AutoSize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "content/common/browser_plugin_messages.h" 10 #include "content/common/browser_plugin_messages.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 // Disable autosize and verify that the BrowserPlugin issues a 675 // Disable autosize and verify that the BrowserPlugin issues a
676 // BrowserPluginHostMsg_SetAutoSize with the change. 676 // BrowserPluginHostMsg_SetAutoSize with the change.
677 ExecuteJavaScript(kDisableAutoSize); 677 ExecuteJavaScript(kDisableAutoSize);
678 ProcessPendingMessages(); 678 ProcessPendingMessages();
679 { 679 {
680 const IPC::Message* auto_size_msg = 680 const IPC::Message* auto_size_msg =
681 browser_plugin_manager()->sink().GetUniqueMessageMatching( 681 browser_plugin_manager()->sink().GetUniqueMessageMatching(
682 BrowserPluginHostMsg_SetAutoSize::ID); 682 BrowserPluginHostMsg_SetAutoSize::ID);
683 ASSERT_TRUE(auto_size_msg); 683 ASSERT_TRUE(auto_size_msg);
684 684
685 int instance_id; 685 PickleIterator iter = IPC::SyncMessage::GetDataIterator(auto_size_msg);
686 BrowserPluginHostMsg_AutoSize_Params params; 686 BrowserPluginHostMsg_SetAutoSize::SendParam set_auto_size_params;
687 BrowserPluginHostMsg_SetAutoSize::Read( 687 ASSERT_TRUE(IPC::ReadParam(auto_size_msg, &iter, &set_auto_size_params));
688 auto_size_msg, 688 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params =
689 &instance_id, 689 set_auto_size_params.b;
690 &params); 690 EXPECT_FALSE(auto_size_params.enable);
691 EXPECT_FALSE(params.enable); 691 EXPECT_EQ(42, auto_size_params.min_width);
692 EXPECT_EQ(42, params.min_width); 692 EXPECT_EQ(43, auto_size_params.min_height);
693 EXPECT_EQ(43, params.min_height); 693 EXPECT_EQ(1337, auto_size_params.max_width);
694 EXPECT_EQ(1337, params.max_width); 694 EXPECT_EQ(1338, auto_size_params.max_height);
695 EXPECT_EQ(1338, params.max_height);
696 } 695 }
697 } 696 }
698 697
699 } // namespace content 698 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698