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

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

Issue 10535077: TabContentsWrapper -> TabContents, part 12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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/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"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
15 #include "chrome/test/base/ui_test_utils.h" 15 #include "chrome/test/base/ui_test_utils.h"
16 #include "content/public/browser/render_process_host.h" 16 #include "content/public/browser/render_process_host.h"
17 #include "content/public/browser/render_view_host.h" 17 #include "content/public/browser/render_view_host.h"
18 #include "content/public/browser/site_instance.h" 18 #include "content/public/browser/site_instance.h"
19 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
20 #include "net/base/mock_host_resolver.h" 20 #include "net/base/mock_host_resolver.h"
21 21
22 using content::NavigationController; 22 using content::NavigationController;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // process, even if they aren't in the app manifest.) 116 // process, even if they aren't in the app manifest.)
117 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6")); 117 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6"));
118 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame")); 118 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame"));
119 119
120 // Check that isolation persists even if the tab crashes and is reloaded. 120 // Check that isolation persists even if the tab crashes and is reloaded.
121 browser()->SelectNumberedTab(1); 121 browser()->SelectNumberedTab(1);
122 ui_test_utils::CrashTab(tab1); 122 ui_test_utils::CrashTab(tab1);
123 ui_test_utils::WindowedNotificationObserver observer( 123 ui_test_utils::WindowedNotificationObserver observer(
124 content::NOTIFICATION_LOAD_STOP, 124 content::NOTIFICATION_LOAD_STOP,
125 content::Source<NavigationController>( 125 content::Source<NavigationController>(
126 &browser()->GetSelectedTabContentsWrapper()->web_contents()-> 126 &browser()->GetActiveWebContents()->GetController()));
127 GetController()));
128 browser()->Reload(CURRENT_TAB); 127 browser()->Reload(CURRENT_TAB);
129 observer.Wait(); 128 observer.Wait();
130 EXPECT_TRUE(HasCookie(tab1, "app1=3")); 129 EXPECT_TRUE(HasCookie(tab1, "app1=3"));
131 EXPECT_FALSE(HasCookie(tab1, "app2")); 130 EXPECT_FALSE(HasCookie(tab1, "app2"));
132 EXPECT_FALSE(HasCookie(tab1, "normalPage")); 131 EXPECT_FALSE(HasCookie(tab1, "normalPage"));
133 } 132 }
134 133
135 // Ensure that cookies are not isolated if the isolated apps are not installed. 134 // Ensure that cookies are not isolated if the isolated apps are not installed.
136 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, NoCookieIsolationWithoutApp) { 135 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, NoCookieIsolationWithoutApp) {
137 host_resolver()->AddRule("*", "127.0.0.1"); 136 host_resolver()->AddRule("*", "127.0.0.1");
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 browser()->GetWebContentsAt(2)->GetRenderProcessHost()->GetID()); 216 browser()->GetWebContentsAt(2)->GetRenderProcessHost()->GetID());
218 EXPECT_NE(process_id_0, 217 EXPECT_NE(process_id_0,
219 browser()->GetWebContentsAt(3)->GetRenderProcessHost()->GetID()); 218 browser()->GetWebContentsAt(3)->GetRenderProcessHost()->GetID());
220 219
221 // Navigating the second tab out of the app should cause a process swap. 220 // Navigating the second tab out of the app should cause a process swap.
222 const GURL& non_app_url(base_url.Resolve("non_app/main.html")); 221 const GURL& non_app_url(base_url.Resolve("non_app/main.html"));
223 NavigateInRenderer(browser()->GetWebContentsAt(1), non_app_url); 222 NavigateInRenderer(browser()->GetWebContentsAt(1), non_app_url);
224 EXPECT_NE(process_id_1, 223 EXPECT_NE(process_id_1,
225 browser()->GetWebContentsAt(1)->GetRenderProcessHost()->GetID()); 224 browser()->GetWebContentsAt(1)->GetRenderProcessHost()->GetID());
226 } 225 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.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