OLD | NEW |
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 "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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // process, even if they aren't in the app manifest.) | 111 // process, even if they aren't in the app manifest.) |
112 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6")); | 112 EXPECT_TRUE(HasCookie(tab1, "nonAppFrame=6")); |
113 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame")); | 113 EXPECT_FALSE(HasCookie(tab3, "nonAppFrame")); |
114 | 114 |
115 // Check that isolation persists even if the tab crashes and is reloaded. | 115 // Check that isolation persists even if the tab crashes and is reloaded. |
116 browser()->SelectNumberedTab(1); | 116 browser()->SelectNumberedTab(1); |
117 ui_test_utils::CrashTab(tab1); | 117 ui_test_utils::CrashTab(tab1); |
118 ui_test_utils::WindowedNotificationObserver observer( | 118 ui_test_utils::WindowedNotificationObserver observer( |
119 content::NOTIFICATION_LOAD_STOP, | 119 content::NOTIFICATION_LOAD_STOP, |
120 content::Source<NavigationController>( | 120 content::Source<NavigationController>( |
121 &browser()->GetSelectedTabContentsWrapper()->controller())); | 121 &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> |
| 122 controller())); |
122 browser()->Reload(CURRENT_TAB); | 123 browser()->Reload(CURRENT_TAB); |
123 observer.Wait(); | 124 observer.Wait(); |
124 EXPECT_TRUE(HasCookie(tab1, "app1=3")); | 125 EXPECT_TRUE(HasCookie(tab1, "app1=3")); |
125 EXPECT_FALSE(HasCookie(tab1, "app2")); | 126 EXPECT_FALSE(HasCookie(tab1, "app2")); |
126 EXPECT_FALSE(HasCookie(tab1, "normalPage")); | 127 EXPECT_FALSE(HasCookie(tab1, "normalPage")); |
127 } | 128 } |
128 | 129 |
129 // Ensure that cookies are not isolated if the isolated apps are not installed. | 130 // Ensure that cookies are not isolated if the isolated apps are not installed. |
130 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, NoCookieIsolationWithoutApp) { | 131 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, NoCookieIsolationWithoutApp) { |
131 host_resolver()->AddRule("*", "127.0.0.1"); | 132 host_resolver()->AddRule("*", "127.0.0.1"); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 EXPECT_NE(hosted1_host, web1_host); | 289 EXPECT_NE(hosted1_host, web1_host); |
289 EXPECT_NE(hosted1_host, extension1_host); | 290 EXPECT_NE(hosted1_host, extension1_host); |
290 | 291 |
291 // Web pages only share with each other. | 292 // Web pages only share with each other. |
292 EXPECT_EQ(web1_host, web2_host); | 293 EXPECT_EQ(web1_host, web2_host); |
293 EXPECT_NE(web1_host, extension1_host); | 294 EXPECT_NE(web1_host, extension1_host); |
294 | 295 |
295 // Extensions only share with each other. | 296 // Extensions only share with each other. |
296 EXPECT_EQ(extension1_host, extension2_host); | 297 EXPECT_EQ(extension1_host, extension2_host); |
297 } | 298 } |
OLD | NEW |