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

Unified Diff: chrome/browser/extensions/isolated_app_apitest.cc

Issue 7612016: Tie extension/app initialization to RenderView creation, not RenderViewHost creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment.x Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/isolated_app_apitest.cc
diff --git a/chrome/browser/extensions/isolated_app_apitest.cc b/chrome/browser/extensions/isolated_app_apitest.cc
index d7bcccf2e52c0df71f82beac4dc271303bcac61e..4ae84764330e094e0fd49f766e014825a2ccb65b 100644
--- a/chrome/browser/extensions/isolated_app_apitest.cc
+++ b/chrome/browser/extensions/isolated_app_apitest.cc
@@ -90,27 +90,36 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppApiTest, MAYBE_CookieIsolation) {
ASSERT_TRUE(!GetInstalledApp(tab3));
// Check that each tab sees its own cookie.
- ASSERT_TRUE(HasCookie(tab1, "app1=3"));
- ASSERT_TRUE(HasCookie(tab2, "app2=4"));
- ASSERT_TRUE(HasCookie(tab3, "normalPage=5"));
+ EXPECT_TRUE(HasCookie(tab1, "app1=3"));
+ EXPECT_TRUE(HasCookie(tab2, "app2=4"));
+ EXPECT_TRUE(HasCookie(tab3, "normalPage=5"));
// Check that app1 tab cannot see the other cookies.
- ASSERT_FALSE(HasCookie(tab1, "app2"));
- ASSERT_FALSE(HasCookie(tab1, "normalPage"));
+ EXPECT_FALSE(HasCookie(tab1, "app2"));
+ EXPECT_FALSE(HasCookie(tab1, "normalPage"));
// Check that app2 tab cannot see the other cookies.
- ASSERT_FALSE(HasCookie(tab2, "app1"));
- ASSERT_FALSE(HasCookie(tab2, "normalPage"));
+ EXPECT_FALSE(HasCookie(tab2, "app1"));
+ EXPECT_FALSE(HasCookie(tab2, "normalPage"));
// Check that normal tab cannot see the other cookies.
- ASSERT_FALSE(HasCookie(tab3, "app1"));
- ASSERT_FALSE(HasCookie(tab3, "app2"));
+ EXPECT_FALSE(HasCookie(tab3, "app1"));
+ EXPECT_FALSE(HasCookie(tab3, "app2"));
// Check that the non_app iframe cookie is associated with app1 and not the
// normal tab. (For now, iframes are always rendered in their parent
// process, even if they aren't in the app manifest.)
- ASSERT_TRUE(HasCookie(tab1, "nonAppFrame=6"));
- ASSERT_FALSE(HasCookie(tab3, "nonAppFrame"));
+ EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6"));
+ EXPECT_FALSE(HasCookie(tab3, "nonAppFrame"));
+
+ // Check that isolation persists even if the tab crashes and is reloaded.
+ browser()->SelectNumberedTab(1);
+ ui_test_utils::CrashTab(tab1);
+ browser()->Reload(CURRENT_TAB);
+ ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
+ EXPECT_TRUE(HasCookie(tab1, "app1=3"));
+ EXPECT_FALSE(HasCookie(tab1, "app2"));
+ EXPECT_FALSE(HasCookie(tab1, "normalPage"));
}
// Ensure that cookies are not isolated if the isolated apps are not installed.
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/renderer_host/chrome_render_view_host_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698