OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
9 #include "content/browser/browsing_instance.h" | 9 #include "content/browser/browsing_instance.h" |
10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 EXPECT_EQ(1, browsing_delete_counter); | 242 EXPECT_EQ(1, browsing_delete_counter); |
243 // browsing_instance is now deleted | 243 // browsing_instance is now deleted |
244 | 244 |
245 // Ensure that instances are deleted when their RenderViewHosts are gone. | 245 // Ensure that instances are deleted when their RenderViewHosts are gone. |
246 scoped_ptr<TestBrowserContext> browser_context(new TestBrowserContext()); | 246 scoped_ptr<TestBrowserContext> browser_context(new TestBrowserContext()); |
247 instance = | 247 instance = |
248 TestSiteInstance::CreateTestSiteInstance(browser_context.get(), | 248 TestSiteInstance::CreateTestSiteInstance(browser_context.get(), |
249 &site_delete_counter, | 249 &site_delete_counter, |
250 &browsing_delete_counter); | 250 &browsing_delete_counter); |
251 { | 251 { |
252 TabContents contents(browser_context.get(), | 252 WebContentsImpl web_contents(browser_context.get(), |
253 instance, | 253 instance, |
254 MSG_ROUTING_NONE, | 254 MSG_ROUTING_NONE, |
255 NULL, | 255 NULL, |
256 NULL); | 256 NULL); |
257 EXPECT_EQ(1, site_delete_counter); | 257 EXPECT_EQ(1, site_delete_counter); |
258 EXPECT_EQ(1, browsing_delete_counter); | 258 EXPECT_EQ(1, browsing_delete_counter); |
259 } | 259 } |
260 | 260 |
261 // Make sure that we flush any messages related to the above TabContents | 261 // Make sure that we flush any messages related to the above TabContents |
262 // destruction. | 262 // destruction. |
263 MessageLoop::current()->RunAllPending(); | 263 MessageLoop::current()->RunAllPending(); |
264 | 264 |
265 EXPECT_EQ(2, site_delete_counter); | 265 EXPECT_EQ(2, site_delete_counter); |
266 EXPECT_EQ(2, browsing_delete_counter); | 266 EXPECT_EQ(2, browsing_delete_counter); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 host.reset(instance->GetProcess()); | 614 host.reset(instance->GetProcess()); |
615 EXPECT_TRUE(host.get() != NULL); | 615 EXPECT_TRUE(host.get() != NULL); |
616 EXPECT_TRUE(instance->HasProcess()); | 616 EXPECT_TRUE(instance->HasProcess()); |
617 | 617 |
618 EXPECT_FALSE(instance->HasWrongProcessForURL(GURL("http://evernote.com"))); | 618 EXPECT_FALSE(instance->HasWrongProcessForURL(GURL("http://evernote.com"))); |
619 EXPECT_FALSE(instance->HasWrongProcessForURL( | 619 EXPECT_FALSE(instance->HasWrongProcessForURL( |
620 GURL("javascript:alert(document.location.href);"))); | 620 GURL("javascript:alert(document.location.href);"))); |
621 | 621 |
622 EXPECT_TRUE(instance->HasWrongProcessForURL(GURL("chrome://settings"))); | 622 EXPECT_TRUE(instance->HasWrongProcessForURL(GURL("chrome://settings"))); |
623 } | 623 } |
OLD | NEW |