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

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

Issue 305103003: Fix for 'Simple Adblock' extension crashes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: #include <map> Created 6 years, 6 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 "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 "base/time/time.h" 7 #include "base/time/time.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "content/browser/frame_host/render_frame_host_impl.h" 9 #include "content/browser/frame_host/render_frame_host_impl.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 GURL test_url = embedded_test_server()->GetURL("/touch_selection.html"); 123 GURL test_url = embedded_test_server()->GetURL("/touch_selection.html");
124 NavigateToURL(shell(), test_url); 124 NavigateToURL(shell(), test_url);
125 125
126 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); 126 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost();
127 EXPECT_FALSE(rvh->IsFocusedElementEditable()); 127 EXPECT_FALSE(rvh->IsFocusedElementEditable());
128 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), "focus_textfield();")); 128 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), "focus_textfield();"));
129 EXPECT_TRUE(rvh->IsFocusedElementEditable()); 129 EXPECT_TRUE(rvh->IsFocusedElementEditable());
130 } 130 }
131 131
132 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, ReleaseSessionOnCloseACK) {
133 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
134 GURL test_url = embedded_test_server()->GetURL(
135 "/access-session-storage.html");
136 NavigateToURL(shell(), test_url);
137
138 // Make a new Shell, a seperate tab with it's own session namespace and
139 // have it start loading a url but still be in progress.
140 ShellAddedObserver new_shell_observer;
141 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), "window.open();"));
142 Shell* new_shell = new_shell_observer.GetShell();
143 new_shell->LoadURL(test_url);
144 RenderViewHost* rvh = new_shell->web_contents()->GetRenderViewHost();
145 SiteInstance* site_instance = rvh->GetSiteInstance();
146 scoped_refptr<SessionStorageNamespace> session_namespace =
147 rvh->GetDelegate()->GetSessionStorageNamespace(site_instance);
148 EXPECT_FALSE(session_namespace->HasOneRef());
149
150 // Close it, or rather start the close operation. The session namespace
151 // should remain until RPH gets an ACK from the renderer about having
152 // closed the view.
153 new_shell->Close();
154 EXPECT_FALSE(session_namespace->HasOneRef());
155
156 // Do something that causes ipc queues to flush and tasks in
157 // flight to complete such that we should have received the ACK.
158 NavigateToURL(shell(), test_url);
159
160 // Verify we have the only remaining reference to the namespace.
161 EXPECT_TRUE(session_namespace->HasOneRef());
162 }
163
132 } // namespace content 164 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698