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

Side by Side Diff: content/browser/renderer_host/render_view_host_unittest.cc

Issue 1359163005: Remove surface_id from RenderWidget/RenderWidgetHost and friends (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@channel_creation_preempt
Patch Set: fix more tests Created 5 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
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 "base/path_service.h" 5 #include "base/path_service.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "content/browser/child_process_security_policy_impl.h" 7 #include "content/browser/child_process_security_policy_impl.h"
8 #include "content/browser/frame_host/render_frame_host_impl.h" 8 #include "content/browser/frame_host/render_frame_host_impl.h"
9 #include "content/browser/gpu/gpu_surface_tracker.h"
10 #include "content/browser/renderer_host/render_message_filter.h" 9 #include "content/browser/renderer_host/render_message_filter.h"
11 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 10 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
12 #include "content/browser/renderer_host/render_widget_helper.h" 11 #include "content/browser/renderer_host/render_widget_helper.h"
13 #include "content/common/frame_messages.h" 12 #include "content/common/frame_messages.h"
14 #include "content/common/input_messages.h" 13 #include "content/common/input_messages.h"
15 #include "content/common/view_messages.h" 14 #include "content/common/view_messages.h"
16 #include "content/public/browser/browser_context.h" 15 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/navigation_entry.h" 16 #include "content/public/browser/navigation_entry.h"
18 #include "content/public/common/bindings_policy.h" 17 #include "content/public/common/bindings_policy.h"
19 #include "content/public/common/drop_data.h" 18 #include "content/public/common/drop_data.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 main_test_rfh()->NavigateAndCommitRendererInitiated( 68 main_test_rfh()->NavigateAndCommitRendererInitiated(
70 1, true, GURL("about:cache")); 69 1, true, GURL("about:cache"));
71 ASSERT_TRUE(controller().GetVisibleEntry()); 70 ASSERT_TRUE(controller().GetVisibleEntry());
72 EXPECT_EQ(GURL(url::kAboutBlankURL), 71 EXPECT_EQ(GURL(url::kAboutBlankURL),
73 controller().GetVisibleEntry()->GetURL()); 72 controller().GetVisibleEntry()->GetURL());
74 } 73 }
75 74
76 // Create a full screen popup RenderWidgetHost and View. 75 // Create a full screen popup RenderWidgetHost and View.
77 TEST_F(RenderViewHostTest, CreateFullscreenWidget) { 76 TEST_F(RenderViewHostTest, CreateFullscreenWidget) {
78 int32 routing_id = process()->GetNextRoutingID(); 77 int32 routing_id = process()->GetNextRoutingID();
79 int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( 78 test_rvh()->CreateNewFullscreenWidget(routing_id);
80 process()->GetID(), routing_id);
81 test_rvh()->CreateNewFullscreenWidget(routing_id, surface_id);
82 } 79 }
83 80
84 // Ensure we do not grant bindings to a process shared with unprivileged views. 81 // Ensure we do not grant bindings to a process shared with unprivileged views.
85 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { 82 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) {
86 // Create another view in the same process. 83 // Create another view in the same process.
87 scoped_ptr<TestWebContents> new_web_contents( 84 scoped_ptr<TestWebContents> new_web_contents(
88 TestWebContents::Create(browser_context(), rvh()->GetSiteInstance())); 85 TestWebContents::Create(browser_context(), rvh()->GetSiteInstance()));
89 86
90 rvh()->AllowBindings(BINDINGS_POLICY_WEB_UI); 87 rvh()->AllowBindings(BINDINGS_POLICY_WEB_UI);
91 EXPECT_FALSE(rvh()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); 88 EXPECT_FALSE(rvh()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 const std::string data_url = "data:image/gif;base64," 299 const std::string data_url = "data:image/gif;base64,"
303 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; 300 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=";
304 301
305 tester->Reset(); 302 tester->Reset();
306 tester->Test(data_url); 303 tester->Test(data_url);
307 EXPECT_EQ(tester->UrlString(), data_url); 304 EXPECT_EQ(tester->UrlString(), data_url);
308 EXPECT_TRUE(tester->IsDownloaded()); 305 EXPECT_TRUE(tester->IsDownloaded());
309 } 306 }
310 307
311 } // namespace content 308 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/renderer_host/render_widget_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698