| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 EXPECT_TRUE(HasCookie(browser()->GetWebContentsAt(2), "app1=3")); | 168 EXPECT_TRUE(HasCookie(browser()->GetWebContentsAt(2), "app1=3")); |
| 169 EXPECT_TRUE(HasCookie(browser()->GetWebContentsAt(2), "app2=4")); | 169 EXPECT_TRUE(HasCookie(browser()->GetWebContentsAt(2), "app2=4")); |
| 170 EXPECT_TRUE(HasCookie(browser()->GetWebContentsAt(2), "nonAppFrame=6")); | 170 EXPECT_TRUE(HasCookie(browser()->GetWebContentsAt(2), "nonAppFrame=6")); |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Ensure that an isolated app never shares a process with WebUIs, non-isolated | 173 // Ensure that an isolated app never shares a process with WebUIs, non-isolated |
| 174 // extensions, and normal webpages. None of these should ever comingle | 174 // extensions, and normal webpages. None of these should ever comingle |
| 175 // RenderProcessHosts even if we hit the process limit. | 175 // RenderProcessHosts even if we hit the process limit. |
| 176 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, ProcessOverflow) { | 176 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, ProcessOverflow) { |
| 177 // Set max renderers to 1 to force running out of processes. | 177 // Set max renderers to 1 to force running out of processes. |
| 178 content::RenderProcessHost::SetMaxRendererProcessCountForTest(1); | 178 content::RenderProcessHost::SetMaxRendererProcessCount(1); |
| 179 | 179 |
| 180 host_resolver()->AddRule("*", "127.0.0.1"); | 180 host_resolver()->AddRule("*", "127.0.0.1"); |
| 181 ASSERT_TRUE(test_server()->Start()); | 181 ASSERT_TRUE(test_server()->Start()); |
| 182 | 182 |
| 183 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); | 183 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
| 184 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); | 184 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); |
| 185 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("hosted_app"))); | 185 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("hosted_app"))); |
| 186 ASSERT_TRUE( | 186 ASSERT_TRUE( |
| 187 LoadExtension(test_data_dir_.AppendASCII("api_test/app_process"))); | 187 LoadExtension(test_data_dir_.AppendASCII("api_test/app_process"))); |
| 188 | 188 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 EXPECT_NE(hosted1_host, web1_host); | 294 EXPECT_NE(hosted1_host, web1_host); |
| 295 EXPECT_NE(hosted1_host, extension1_host); | 295 EXPECT_NE(hosted1_host, extension1_host); |
| 296 | 296 |
| 297 // Web pages only share with each other. | 297 // Web pages only share with each other. |
| 298 EXPECT_EQ(web1_host, web2_host); | 298 EXPECT_EQ(web1_host, web2_host); |
| 299 EXPECT_NE(web1_host, extension1_host); | 299 EXPECT_NE(web1_host, extension1_host); |
| 300 | 300 |
| 301 // Extensions only share with each other. | 301 // Extensions only share with each other. |
| 302 EXPECT_EQ(extension1_host, extension2_host); | 302 EXPECT_EQ(extension1_host, extension2_host); |
| 303 } | 303 } |
| OLD | NEW |