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_browser_process_test.h" | |
9 #include "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
10 #include "content/browser/browser_thread.h" | 9 #include "content/browser/browser_thread.h" |
11 #include "content/browser/browsing_instance.h" | 10 #include "content/browser/browsing_instance.h" |
12 #include "content/browser/child_process_security_policy.h" | 11 #include "content/browser/child_process_security_policy.h" |
13 #include "content/browser/mock_content_browser_client.h" | 12 #include "content/browser/mock_content_browser_client.h" |
14 #include "content/browser/renderer_host/browser_render_process_host.h" | 13 #include "content/browser/renderer_host/browser_render_process_host.h" |
15 #include "content/browser/renderer_host/render_view_host.h" | 14 #include "content/browser/renderer_host/render_view_host.h" |
16 #include "content/browser/renderer_host/test_render_view_host.h" | 15 #include "content/browser/renderer_host/test_render_view_host.h" |
17 #include "content/browser/site_instance.h" | 16 #include "content/browser/site_instance.h" |
18 #include "content/browser/tab_contents/navigation_entry.h" | 17 #include "content/browser/tab_contents/navigation_entry.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 67 |
69 void SetOriginalClient(content::ContentBrowserClient* old_browser_client) { | 68 void SetOriginalClient(content::ContentBrowserClient* old_browser_client) { |
70 old_browser_client_ = old_browser_client; | 69 old_browser_client_ = old_browser_client; |
71 } | 70 } |
72 | 71 |
73 private: | 72 private: |
74 SiteInstanceTestWebUIFactory factory_; | 73 SiteInstanceTestWebUIFactory factory_; |
75 content::ContentBrowserClient* old_browser_client_; | 74 content::ContentBrowserClient* old_browser_client_; |
76 }; | 75 }; |
77 | 76 |
78 class SiteInstanceTest : public TestingBrowserProcessTest { | 77 class SiteInstanceTest : public testing::Test { |
79 public: | 78 public: |
80 SiteInstanceTest() | 79 SiteInstanceTest() |
81 : ui_thread_(BrowserThread::UI, &message_loop_), | 80 : ui_thread_(BrowserThread::UI, &message_loop_), |
82 old_browser_client_(NULL) { | 81 old_browser_client_(NULL) { |
83 } | 82 } |
84 | 83 |
85 virtual void SetUp() { | 84 virtual void SetUp() { |
86 old_browser_client_ = content::GetContentClient()->browser(); | 85 old_browser_client_ = content::GetContentClient()->browser(); |
87 browser_client_.SetOriginalClient(old_browser_client_); | 86 browser_client_.SetOriginalClient(old_browser_client_); |
88 content::GetContentClient()->set_browser(&browser_client_); | 87 content::GetContentClient()->set_browser(&browser_client_); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // Make sure none of differing privilege processes are mixed. | 526 // Make sure none of differing privilege processes are mixed. |
528 EXPECT_NE(extension1_instance->GetProcess(), webui1_instance->GetProcess()); | 527 EXPECT_NE(extension1_instance->GetProcess(), webui1_instance->GetProcess()); |
529 | 528 |
530 for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) { | 529 for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) { |
531 EXPECT_NE(extension1_instance->GetProcess(), hosts[i]); | 530 EXPECT_NE(extension1_instance->GetProcess(), hosts[i]); |
532 EXPECT_NE(webui1_instance->GetProcess(), hosts[i]); | 531 EXPECT_NE(webui1_instance->GetProcess(), hosts[i]); |
533 } | 532 } |
534 | 533 |
535 STLDeleteContainerPointers(hosts.begin(), hosts.end()); | 534 STLDeleteContainerPointers(hosts.begin(), hosts.end()); |
536 } | 535 } |
OLD | NEW |