| 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/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "base/string16.h" | 7 #include "base/string16.h" |
| 8 #include "content/browser/browsing_instance.h" | 8 #include "content/browser/browsing_instance.h" |
| 9 #include "content/browser/child_process_security_policy.h" | 9 #include "content/browser/child_process_security_policy.h" |
| 10 #include "content/browser/mock_content_browser_client.h" | 10 #include "content/browser/mock_content_browser_client.h" |
| 11 #include "content/browser/renderer_host/browser_render_process_host.h" | 11 #include "content/browser/renderer_host/browser_render_process_host.h" |
| 12 #include "content/browser/renderer_host/render_view_host.h" | 12 #include "content/browser/renderer_host/render_view_host.h" |
| 13 #include "content/browser/renderer_host/test_render_view_host.h" | 13 #include "content/browser/renderer_host/test_render_view_host.h" |
| 14 #include "content/browser/site_instance.h" | 14 #include "content/browser/site_instance.h" |
| 15 #include "content/browser/tab_contents/navigation_entry.h" | 15 #include "content/browser/tab_contents/navigation_entry.h" |
| 16 #include "content/browser/tab_contents/tab_contents.h" | 16 #include "content/browser/tab_contents/tab_contents.h" |
| 17 #include "content/browser/webui/empty_web_ui_factory.h" | 17 #include "content/browser/webui/empty_web_ui_factory.h" |
| 18 #include "content/public/common/content_client.h" | 18 #include "content/public/common/content_client.h" |
| 19 #include "content/public/common/content_constants.h" | 19 #include "content/public/common/content_constants.h" |
| 20 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
| 21 #include "content/test/test_browser_context.h" | 21 #include "content/test/test_browser_context.h" |
| 22 #include "content/test/test_browser_thread.h" | 22 #include "content/test/test_browser_thread.h" |
| 23 #include "googleurl/src/url_util.h" | 23 #include "googleurl/src/url_util.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 | 25 |
| 26 using content::BrowserThread; |
| 27 |
| 26 namespace { | 28 namespace { |
| 27 | 29 |
| 28 const char kSameAsAnyInstanceURL[] = "about:internets"; | 30 const char kSameAsAnyInstanceURL[] = "about:internets"; |
| 29 | 31 |
| 30 const char kPrivilegedScheme[] = "privileged"; | 32 const char kPrivilegedScheme[] = "privileged"; |
| 31 | 33 |
| 32 class SiteInstanceTestWebUIFactory : public content::EmptyWebUIFactory { | 34 class SiteInstanceTestWebUIFactory : public content::EmptyWebUIFactory { |
| 33 public: | 35 public: |
| 34 virtual bool UseWebUIForURL(content::BrowserContext* browser_context, | 36 virtual bool UseWebUIForURL(content::BrowserContext* browser_context, |
| 35 const GURL& url) const OVERRIDE { | 37 const GURL& url) const OVERRIDE { |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // Make sure none of differing privilege processes are mixed. | 561 // Make sure none of differing privilege processes are mixed. |
| 560 EXPECT_NE(extension1_instance->GetProcess(), webui1_instance->GetProcess()); | 562 EXPECT_NE(extension1_instance->GetProcess(), webui1_instance->GetProcess()); |
| 561 | 563 |
| 562 for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) { | 564 for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) { |
| 563 EXPECT_NE(extension1_instance->GetProcess(), hosts[i]); | 565 EXPECT_NE(extension1_instance->GetProcess(), hosts[i]); |
| 564 EXPECT_NE(webui1_instance->GetProcess(), hosts[i]); | 566 EXPECT_NE(webui1_instance->GetProcess(), hosts[i]); |
| 565 } | 567 } |
| 566 | 568 |
| 567 STLDeleteContainerPointers(hosts.begin(), hosts.end()); | 569 STLDeleteContainerPointers(hosts.begin(), hosts.end()); |
| 568 } | 570 } |
| OLD | NEW |