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

Side by Side Diff: chrome/browser/extensions/isolated_app_browsertest.cc

Issue 10833029: Move ui_test_utils::CrashTab to browser_test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/automation/automation_util.h" 6 #include "chrome/browser/automation/automation_util.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 EXPECT_FALSE(HasCookie(tab3, "app2")); 163 EXPECT_FALSE(HasCookie(tab3, "app2"));
164 164
165 // Check that the non_app iframe cookie is associated with app1 and not the 165 // Check that the non_app iframe cookie is associated with app1 and not the
166 // normal tab. (For now, iframes are always rendered in their parent 166 // normal tab. (For now, iframes are always rendered in their parent
167 // process, even if they aren't in the app manifest.) 167 // process, even if they aren't in the app manifest.)
168 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6")); 168 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6"));
169 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame")); 169 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame"));
170 170
171 // Check that isolation persists even if the tab crashes and is reloaded. 171 // Check that isolation persists even if the tab crashes and is reloaded.
172 chrome::SelectNumberedTab(browser(), 0); 172 chrome::SelectNumberedTab(browser(), 0);
173 ui_test_utils::CrashTab(tab1); 173 content::CrashTab(tab1);
174 content::WindowedNotificationObserver observer( 174 content::WindowedNotificationObserver observer(
175 content::NOTIFICATION_LOAD_STOP, 175 content::NOTIFICATION_LOAD_STOP,
176 content::Source<NavigationController>( 176 content::Source<NavigationController>(
177 &chrome::GetActiveWebContents(browser())->GetController())); 177 &chrome::GetActiveWebContents(browser())->GetController()));
178 chrome::Reload(browser(), CURRENT_TAB); 178 chrome::Reload(browser(), CURRENT_TAB);
179 observer.Wait(); 179 observer.Wait();
180 EXPECT_TRUE(HasCookie(tab1, "app1=3")); 180 EXPECT_TRUE(HasCookie(tab1, "app1=3"));
181 EXPECT_FALSE(HasCookie(tab1, "app2")); 181 EXPECT_FALSE(HasCookie(tab1, "app2"));
182 EXPECT_FALSE(HasCookie(tab1, "normalPage")); 182 EXPECT_FALSE(HasCookie(tab1, "normalPage"));
183 183
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 chrome::GetWebContentsAt(browser(), 2)->GetRenderProcessHost()->GetI D()); 297 chrome::GetWebContentsAt(browser(), 2)->GetRenderProcessHost()->GetI D());
298 EXPECT_NE(process_id_0, 298 EXPECT_NE(process_id_0,
299 chrome::GetWebContentsAt(browser(), 3)->GetRenderProcessHost()->GetI D()); 299 chrome::GetWebContentsAt(browser(), 3)->GetRenderProcessHost()->GetI D());
300 300
301 // Navigating the second tab out of the app should cause a process swap. 301 // Navigating the second tab out of the app should cause a process swap.
302 const GURL& non_app_url(base_url.Resolve("non_app/main.html")); 302 const GURL& non_app_url(base_url.Resolve("non_app/main.html"));
303 NavigateInRenderer(chrome::GetWebContentsAt(browser(), 1), non_app_url); 303 NavigateInRenderer(chrome::GetWebContentsAt(browser(), 1), non_app_url);
304 EXPECT_NE(process_id_1, 304 EXPECT_NE(process_id_1,
305 chrome::GetWebContentsAt(browser(), 1)->GetRenderProcessHost()->GetI D()); 305 chrome::GetWebContentsAt(browser(), 1)->GetRenderProcessHost()->GetI D());
306 } 306 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698