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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client_browsertest.cc

Issue 1069703002: Replace the struct workaround for forward-declaring ChromeViewHostMsg_GetPluginInfo_Status with a p… (Closed) Base URL: https://chromium.googlesource.com/chromium/src@issue444203
Patch Set: update base branch Created 5 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 TEST_F(CreatePluginPlaceholderTest, MissingPlugin) { 127 TEST_F(CreatePluginPlaceholderTest, MissingPlugin) {
128 GURL url("http://www.example.com/example.swf"); 128 GURL url("http://www.example.com/example.swf");
129 std::string mime_type("application/x-shockwave-flash"); 129 std::string mime_type("application/x-shockwave-flash");
130 130
131 blink::WebPluginParams params; 131 blink::WebPluginParams params;
132 params.url = url; 132 params.url = url;
133 params.mimeType = base::ASCIIToUTF16(mime_type); 133 params.mimeType = base::ASCIIToUTF16(mime_type);
134 134
135 ChromeViewHostMsg_GetPluginInfo_Output output; 135 ChromeViewHostMsg_GetPluginInfo_Output output;
136 output.status.value = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound; 136 output.status = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound;
137 137
138 ScopedMockPluginInfoFilter filter(render_thread_.get()); 138 ScopedMockPluginInfoFilter filter(render_thread_.get());
139 #if defined(ENABLE_PLUGINS) 139 #if defined(ENABLE_PLUGINS)
140 EXPECT_CALL(filter, OnGetPluginInfo(GetRoutingID(), url, _, mime_type, _)) 140 EXPECT_CALL(filter, OnGetPluginInfo(GetRoutingID(), url, _, mime_type, _))
141 .WillOnce(SetArgPointee<4>(output)); 141 .WillOnce(SetArgPointee<4>(output));
142 #endif 142 #endif
143 143
144 scoped_ptr<blink::WebPluginPlaceholder> placeholder = 144 scoped_ptr<blink::WebPluginPlaceholder> placeholder =
145 content_renderer_client_->CreatePluginPlaceholder( 145 content_renderer_client_->CreatePluginPlaceholder(
146 GetMainRenderFrame(), GetMainFrame(), params); 146 GetMainRenderFrame(), GetMainFrame(), params);
147 ASSERT_NE(nullptr, placeholder); 147 ASSERT_NE(nullptr, placeholder);
148 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED), 148 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED),
149 placeholder->message()); 149 placeholder->message());
150 } 150 }
151 151
152 TEST_F(CreatePluginPlaceholderTest, PluginFound) { 152 TEST_F(CreatePluginPlaceholderTest, PluginFound) {
153 GURL url("http://www.example.com/example.swf"); 153 GURL url("http://www.example.com/example.swf");
154 std::string mime_type(content::kFlashPluginSwfMimeType); 154 std::string mime_type(content::kFlashPluginSwfMimeType);
155 155
156 blink::WebPluginParams params; 156 blink::WebPluginParams params;
157 params.url = url; 157 params.url = url;
158 params.mimeType = base::ASCIIToUTF16(mime_type); 158 params.mimeType = base::ASCIIToUTF16(mime_type);
159 159
160 ChromeViewHostMsg_GetPluginInfo_Output output; 160 ChromeViewHostMsg_GetPluginInfo_Output output;
161 output.status.value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed; 161 output.status = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed;
162 162
163 ScopedMockPluginInfoFilter filter(render_thread_.get()); 163 ScopedMockPluginInfoFilter filter(render_thread_.get());
164 #if defined(ENABLE_PLUGINS) 164 #if defined(ENABLE_PLUGINS)
165 EXPECT_CALL(filter, OnGetPluginInfo(GetRoutingID(), url, _, mime_type, _)) 165 EXPECT_CALL(filter, OnGetPluginInfo(GetRoutingID(), url, _, mime_type, _))
166 .WillOnce(SetArgPointee<4>(output)); 166 .WillOnce(SetArgPointee<4>(output));
167 #endif 167 #endif
168 168
169 scoped_ptr<blink::WebPluginPlaceholder> placeholder = 169 scoped_ptr<blink::WebPluginPlaceholder> placeholder =
170 content_renderer_client_->CreatePluginPlaceholder( 170 content_renderer_client_->CreatePluginPlaceholder(
171 GetMainRenderFrame(), GetMainFrame(), params); 171 GetMainRenderFrame(), GetMainFrame(), params);
172 EXPECT_EQ(nullptr, placeholder); 172 EXPECT_EQ(nullptr, placeholder);
173 } 173 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/plugins/chrome_plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698