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 "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
| 9 #include "chrome/test/testing_browser_process_test.h" |
9 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
10 #include "content/browser/browsing_instance.h" | 11 #include "content/browser/browsing_instance.h" |
11 #include "content/browser/child_process_security_policy.h" | 12 #include "content/browser/child_process_security_policy.h" |
12 #include "content/browser/mock_content_browser_client.h" | 13 #include "content/browser/mock_content_browser_client.h" |
13 #include "content/browser/renderer_host/browser_render_process_host.h" | 14 #include "content/browser/renderer_host/browser_render_process_host.h" |
14 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
15 #include "content/browser/renderer_host/test_render_view_host.h" | 16 #include "content/browser/renderer_host/test_render_view_host.h" |
16 #include "content/browser/site_instance.h" | 17 #include "content/browser/site_instance.h" |
17 #include "content/browser/tab_contents/navigation_entry.h" | 18 #include "content/browser/tab_contents/navigation_entry.h" |
18 #include "content/browser/tab_contents/tab_contents.h" | 19 #include "content/browser/tab_contents/tab_contents.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 56 |
56 virtual GURL GetEffectiveURL(content::BrowserContext* browser_context, | 57 virtual GURL GetEffectiveURL(content::BrowserContext* browser_context, |
57 const GURL& url) OVERRIDE { | 58 const GURL& url) OVERRIDE { |
58 return url; | 59 return url; |
59 } | 60 } |
60 | 61 |
61 private: | 62 private: |
62 SiteInstanceTestWebUIFactory factory_; | 63 SiteInstanceTestWebUIFactory factory_; |
63 }; | 64 }; |
64 | 65 |
65 class SiteInstanceTest : public testing::Test { | 66 class SiteInstanceTest : public TestingBrowserProcessTest { |
66 public: | 67 public: |
67 SiteInstanceTest() | 68 SiteInstanceTest() |
68 : ui_thread_(BrowserThread::UI, &message_loop_), | 69 : ui_thread_(BrowserThread::UI, &message_loop_), |
69 old_browser_client_(NULL) { | 70 old_browser_client_(NULL) { |
70 } | 71 } |
71 | 72 |
72 virtual void SetUp() { | 73 virtual void SetUp() { |
73 old_browser_client_ = content::GetContentClient()->browser(); | 74 old_browser_client_ = content::GetContentClient()->browser(); |
74 content::GetContentClient()->set_browser(&browser_client_); | 75 content::GetContentClient()->set_browser(&browser_client_); |
75 } | 76 } |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 // Make sure none of differing privilege processes are mixed. | 514 // Make sure none of differing privilege processes are mixed. |
514 EXPECT_NE(extension1_instance->GetProcess(), webui1_instance->GetProcess()); | 515 EXPECT_NE(extension1_instance->GetProcess(), webui1_instance->GetProcess()); |
515 | 516 |
516 for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) { | 517 for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) { |
517 EXPECT_NE(extension1_instance->GetProcess(), hosts[i]); | 518 EXPECT_NE(extension1_instance->GetProcess(), hosts[i]); |
518 EXPECT_NE(webui1_instance->GetProcess(), hosts[i]); | 519 EXPECT_NE(webui1_instance->GetProcess(), hosts[i]); |
519 } | 520 } |
520 | 521 |
521 STLDeleteContainerPointers(hosts.begin(), hosts.end()); | 522 STLDeleteContainerPointers(hosts.begin(), hosts.end()); |
522 } | 523 } |
OLD | NEW |