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

Side by Side Diff: content/renderer/pepper/plugin_power_saver_helper_browsertest.cc

Issue 821453003: Update legacy Tuple-using code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: media Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "content/common/frame_messages.h" 6 #include "content/common/frame_messages.h"
7 #include "content/common/view_message_enums.h" 7 #include "content/common/view_message_enums.h"
8 #include "content/public/test/render_view_test.h" 8 #include "content/public/test/render_view_test.h"
9 #include "content/renderer/pepper/plugin_power_saver_helper.h" 9 #include "content/renderer/pepper/plugin_power_saver_helper.h"
10 #include "content/renderer/render_frame_impl.h" 10 #include "content/renderer/render_frame_impl.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 MakeParams("http://b.com/foo.swf", std::string(), "100", "100"), GURL(), 158 MakeParams("http://b.com/foo.swf", std::string(), "100", "100"), GURL(),
159 nullptr, &cross_origin_main_content)); 159 nullptr, &cross_origin_main_content));
160 EXPECT_FALSE(cross_origin_main_content); 160 EXPECT_FALSE(cross_origin_main_content);
161 161
162 // Test that we've sent an IPC to the browser. 162 // Test that we've sent an IPC to the browser.
163 ASSERT_EQ(1u, sink_->message_count()); 163 ASSERT_EQ(1u, sink_->message_count());
164 const IPC::Message* msg = sink_->GetMessageAt(0); 164 const IPC::Message* msg = sink_->GetMessageAt(0);
165 EXPECT_EQ(FrameHostMsg_PluginContentOriginAllowed::ID, msg->type()); 165 EXPECT_EQ(FrameHostMsg_PluginContentOriginAllowed::ID, msg->type());
166 FrameHostMsg_PluginContentOriginAllowed::Param params; 166 FrameHostMsg_PluginContentOriginAllowed::Param params;
167 FrameHostMsg_PluginContentOriginAllowed::Read(msg, &params); 167 FrameHostMsg_PluginContentOriginAllowed::Read(msg, &params);
168 EXPECT_EQ(GURL("http://b.com"), params.a); 168 EXPECT_EQ(GURL("http://b.com"), get<0>(params));
169 } 169 }
170 170
171 TEST_F(PluginPowerSaverHelperTest, UnthrottleOnExPostFactoWhitelist) { 171 TEST_F(PluginPowerSaverHelperTest, UnthrottleOnExPostFactoWhitelist) {
172 base::RunLoop loop; 172 base::RunLoop loop;
173 frame()->RegisterPeripheralPlugin(GURL("http://other.com"), 173 frame()->RegisterPeripheralPlugin(GURL("http://other.com"),
174 loop.QuitClosure()); 174 loop.QuitClosure());
175 175
176 std::set<GURL> origin_whitelist; 176 std::set<GURL> origin_whitelist;
177 origin_whitelist.insert(GURL("http://other.com")); 177 origin_whitelist.insert(GURL("http://other.com"));
178 frame()->OnMessageReceived(FrameMsg_UpdatePluginContentOriginWhitelist( 178 frame()->OnMessageReceived(FrameMsg_UpdatePluginContentOriginWhitelist(
(...skipping 11 matching lines...) Expand all
190 nullptr, nullptr)); 190 nullptr, nullptr));
191 191
192 LoadHTML("<html></html>"); 192 LoadHTML("<html></html>");
193 193
194 EXPECT_TRUE(frame()->ShouldThrottleContent( 194 EXPECT_TRUE(frame()->ShouldThrottleContent(
195 MakeParams("http://b.com/foo.swf", std::string(), "100", "100"), GURL(), 195 MakeParams("http://b.com/foo.swf", std::string(), "100", "100"), GURL(),
196 nullptr, nullptr)); 196 nullptr, nullptr));
197 } 197 }
198 198
199 } // namespace content 199 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698