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

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

Issue 10807047: Create content\public\test\test_utils.h to hold common test classes that are used by unit and brows… (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 163
164 // Check that the non_app iframe cookie is associated with app1 and not the 164 // Check that the non_app iframe cookie is associated with app1 and not the
165 // normal tab. (For now, iframes are always rendered in their parent 165 // normal tab. (For now, iframes are always rendered in their parent
166 // process, even if they aren't in the app manifest.) 166 // process, even if they aren't in the app manifest.)
167 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6")); 167 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6"));
168 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame")); 168 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame"));
169 169
170 // Check that isolation persists even if the tab crashes and is reloaded. 170 // Check that isolation persists even if the tab crashes and is reloaded.
171 chrome::SelectNumberedTab(browser(), 0); 171 chrome::SelectNumberedTab(browser(), 0);
172 ui_test_utils::CrashTab(tab1); 172 ui_test_utils::CrashTab(tab1);
173 ui_test_utils::WindowedNotificationObserver observer( 173 content::WindowedNotificationObserver observer(
174 content::NOTIFICATION_LOAD_STOP, 174 content::NOTIFICATION_LOAD_STOP,
175 content::Source<NavigationController>( 175 content::Source<NavigationController>(
176 &chrome::GetActiveWebContents(browser())->GetController())); 176 &chrome::GetActiveWebContents(browser())->GetController()));
177 chrome::Reload(browser(), CURRENT_TAB); 177 chrome::Reload(browser(), CURRENT_TAB);
178 observer.Wait(); 178 observer.Wait();
179 EXPECT_TRUE(HasCookie(tab1, "app1=3")); 179 EXPECT_TRUE(HasCookie(tab1, "app1=3"));
180 EXPECT_FALSE(HasCookie(tab1, "app2")); 180 EXPECT_FALSE(HasCookie(tab1, "app2"));
181 EXPECT_FALSE(HasCookie(tab1, "normalPage")); 181 EXPECT_FALSE(HasCookie(tab1, "normalPage"));
182 182
183 } 183 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 chrome::GetWebContentsAt(browser(), 2)->GetRenderProcessHost()->GetI D()); 296 chrome::GetWebContentsAt(browser(), 2)->GetRenderProcessHost()->GetI D());
297 EXPECT_NE(process_id_0, 297 EXPECT_NE(process_id_0,
298 chrome::GetWebContentsAt(browser(), 3)->GetRenderProcessHost()->GetI D()); 298 chrome::GetWebContentsAt(browser(), 3)->GetRenderProcessHost()->GetI D());
299 299
300 // Navigating the second tab out of the app should cause a process swap. 300 // Navigating the second tab out of the app should cause a process swap.
301 const GURL& non_app_url(base_url.Resolve("non_app/main.html")); 301 const GURL& non_app_url(base_url.Resolve("non_app/main.html"));
302 NavigateInRenderer(chrome::GetWebContentsAt(browser(), 1), non_app_url); 302 NavigateInRenderer(chrome::GetWebContentsAt(browser(), 1), non_app_url);
303 EXPECT_NE(process_id_1, 303 EXPECT_NE(process_id_1,
304 chrome::GetWebContentsAt(browser(), 1)->GetRenderProcessHost()->GetI D()); 304 chrome::GetWebContentsAt(browser(), 1)->GetRenderProcessHost()->GetI D());
305 } 305 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_startup_browsertest.cc ('k') | chrome/browser/extensions/lazy_background_page_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698