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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 8477042: Move Sad Tab implementation out of the TabContentsViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changes for jochen and jam Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <deque> 5 #include <deque>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 EXPECT_EQ(should_be_shown_, was_shown_); 154 EXPECT_EQ(should_be_shown_, was_shown_);
155 155
156 // When the PrerenderContents is destroyed, quit the UI message loop. 156 // When the PrerenderContents is destroyed, quit the UI message loop.
157 // This happens on navigation to used prerendered pages, and soon 157 // This happens on navigation to used prerendered pages, and soon
158 // after cancellation of unused prerendered pages. 158 // after cancellation of unused prerendered pages.
159 if (quit_message_loop_on_destruction_) 159 if (quit_message_loop_on_destruction_)
160 MessageLoopForUI::current()->Quit(); 160 MessageLoopForUI::current()->Quit();
161 } 161 }
162 162
163 virtual void RenderViewGone() OVERRIDE { 163 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE {
164 // On quit, it's possible to end up here when render processes are closed 164 // On quit, it's possible to end up here when render processes are closed
165 // before the PrerenderManager is destroyed. As a result, it's possible to 165 // before the PrerenderManager is destroyed. As a result, it's possible to
166 // get either FINAL_STATUS_APP_TERMINATING or FINAL_STATUS_RENDERER_CRASHED 166 // get either FINAL_STATUS_APP_TERMINATING or FINAL_STATUS_RENDERER_CRASHED
167 // on quit. 167 // on quit.
168 // 168 //
169 // It's also possible for this to be called after we've been notified of 169 // It's also possible for this to be called after we've been notified of
170 // app termination, but before we've been deleted, which is why the second 170 // app termination, but before we've been deleted, which is why the second
171 // check is needed. 171 // check is needed.
172 if (expected_final_status_ == FINAL_STATUS_APP_TERMINATING && 172 if (expected_final_status_ == FINAL_STATUS_APP_TERMINATING &&
173 final_status() != expected_final_status_) { 173 final_status() != expected_final_status_) {
174 expected_final_status_ = FINAL_STATUS_RENDERER_CRASHED; 174 expected_final_status_ = FINAL_STATUS_RENDERER_CRASHED;
175 } 175 }
176 176
177 PrerenderContents::RenderViewGone(); 177 PrerenderContents::RenderViewGone(status);
178 } 178 }
179 179
180 virtual bool AddAliasURL(const GURL& url) OVERRIDE { 180 virtual bool AddAliasURL(const GURL& url) OVERRIDE {
181 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in 181 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in
182 // the PrerenderRendererCrash test. 182 // the PrerenderRendererCrash test.
183 if (url.spec() != chrome::kAboutCrashURL) 183 if (url.spec() != chrome::kAboutCrashURL)
184 return PrerenderContents::AddAliasURL(url); 184 return PrerenderContents::AddAliasURL(url);
185 return true; 185 return true;
186 } 186 }
187 187
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSessionStorage) { 1840 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSessionStorage) {
1841 set_loader_path("files/prerender/prerender_loader_with_session_storage.html"); 1841 set_loader_path("files/prerender/prerender_loader_with_session_storage.html");
1842 PrerenderTestURL(GetCrossDomainTestUrl("files/prerender/prerender_page.html"), 1842 PrerenderTestURL(GetCrossDomainTestUrl("files/prerender/prerender_page.html"),
1843 FINAL_STATUS_USED, 1843 FINAL_STATUS_USED,
1844 1); 1844 1);
1845 NavigateToDestURL(); 1845 NavigateToDestURL();
1846 GoBackToPageBeforePrerender(browser()); 1846 GoBackToPageBeforePrerender(browser());
1847 } 1847 }
1848 1848
1849 } // namespace prerender 1849 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/notifications/balloon_host.cc ('k') | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698