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

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

Issue 10965048: [BrowserTag] Send dib info with NavigateGuest message, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments from Fady + remove commented code. Created 8 years, 2 months 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // src attribute. 123 // src attribute.
124 { 124 {
125 const IPC::Message* msg = 125 const IPC::Message* msg =
126 browser_plugin_manager()->sink().GetUniqueMessageMatching( 126 browser_plugin_manager()->sink().GetUniqueMessageMatching(
127 BrowserPluginHostMsg_NavigateGuest::ID); 127 BrowserPluginHostMsg_NavigateGuest::ID);
128 ASSERT_TRUE(msg); 128 ASSERT_TRUE(msg);
129 129
130 int instance_id; 130 int instance_id;
131 long long frame_id; 131 long long frame_id;
132 std::string src; 132 std::string src;
133 gfx::Size size; 133 BrowserPluginHostMsg_ResizeGuest_Params resize_params;
134 BrowserPluginHostMsg_NavigateGuest::Read( 134 BrowserPluginHostMsg_NavigateGuest::Read(
135 msg, 135 msg,
136 &instance_id, 136 &instance_id,
137 &frame_id, 137 &frame_id,
138 &src, 138 &src,
139 &size); 139 &resize_params);
140 EXPECT_EQ("foo", src); 140 EXPECT_EQ("foo", src);
141 } 141 }
142 142
143 browser_plugin_manager()->sink().ClearMessages(); 143 browser_plugin_manager()->sink().ClearMessages();
144 // Navigate to bar and observe the associated 144 // Navigate to bar and observe the associated
145 // BrowserPluginHostMsg_NavigateGuest message. 145 // BrowserPluginHostMsg_NavigateGuest message.
146 // Verify that the src attribute is updated as well. 146 // Verify that the src attribute is updated as well.
147 ExecuteJavaScript("document.getElementById('browserplugin').src = 'bar'"); 147 ExecuteJavaScript("document.getElementById('browserplugin').src = 'bar'");
148 { 148 {
149 const IPC::Message* msg = 149 const IPC::Message* msg =
150 browser_plugin_manager()->sink().GetUniqueMessageMatching( 150 browser_plugin_manager()->sink().GetUniqueMessageMatching(
151 BrowserPluginHostMsg_NavigateGuest::ID); 151 BrowserPluginHostMsg_NavigateGuest::ID);
152 ASSERT_TRUE(msg); 152 ASSERT_TRUE(msg);
153 153
154 int instance_id; 154 int instance_id;
155 long long frame_id; 155 long long frame_id;
156 std::string src; 156 std::string src;
157 gfx::Size size; 157 BrowserPluginHostMsg_ResizeGuest_Params resize_params;
158 BrowserPluginHostMsg_NavigateGuest::Read( 158 BrowserPluginHostMsg_NavigateGuest::Read(
159 msg, 159 msg,
160 &instance_id, 160 &instance_id,
161 &frame_id, 161 &frame_id,
162 &src, 162 &src,
163 &size); 163 &resize_params);
164 EXPECT_EQ("bar", src); 164 EXPECT_EQ("bar", src);
165 std::string src_value = 165 std::string src_value =
166 ExecuteScriptAndReturnString( 166 ExecuteScriptAndReturnString(
167 "document.getElementById('browserplugin').src"); 167 "document.getElementById('browserplugin').src");
168 EXPECT_EQ("bar", src_value); 168 EXPECT_EQ("bar", src_value);
169 } 169 }
170 } 170 }
171 171
172 TEST_F(BrowserPluginTest, ResizeFlowControl) { 172 TEST_F(BrowserPluginTest, ResizeFlowControl) {
173 LoadHTML(GetHTMLForBrowserPluginObject().c_str()); 173 LoadHTML(GetHTMLForBrowserPluginObject().c_str());
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 TEST_F(BrowserPluginTest, ReloadMethod) { 349 TEST_F(BrowserPluginTest, ReloadMethod) {
350 const char* kCallReload = 350 const char* kCallReload =
351 "document.getElementById('browserplugin').reload();"; 351 "document.getElementById('browserplugin').reload();";
352 LoadHTML(GetHTMLForBrowserPluginObject().c_str()); 352 LoadHTML(GetHTMLForBrowserPluginObject().c_str());
353 ExecuteJavaScript(kCallReload); 353 ExecuteJavaScript(kCallReload);
354 EXPECT_TRUE(browser_plugin_manager()->sink().GetUniqueMessageMatching( 354 EXPECT_TRUE(browser_plugin_manager()->sink().GetUniqueMessageMatching(
355 BrowserPluginHostMsg_Reload::ID)); 355 BrowserPluginHostMsg_Reload::ID));
356 } 356 }
357 357
358 } // namespace content 358 } // namespace content
OLDNEW
« content/common/browser_plugin_messages.h ('K') | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698