| 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-inl.h" | 6 #include "base/stl_util-inl.h" |
| 7 #include "base/string16.h" | 7 #include "base/string16.h" |
| 8 #include "chrome/test/testing_profile.h" | 8 #include "chrome/test/testing_profile.h" |
| 9 #include "content/browser/browser_thread.h" | 9 #include "content/browser/browser_thread.h" |
| 10 #include "content/browser/browsing_instance.h" | 10 #include "content/browser/browsing_instance.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return url.SchemeIs(chrome::kChromeUIScheme); | 35 return url.SchemeIs(chrome::kChromeUIScheme); |
| 36 } | 36 } |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 class SiteInstanceTestBrowserClient : public content::MockContentBrowserClient { | 39 class SiteInstanceTestBrowserClient : public content::MockContentBrowserClient { |
| 40 public: | 40 public: |
| 41 virtual content::WebUIFactory* GetWebUIFactory() OVERRIDE { | 41 virtual content::WebUIFactory* GetWebUIFactory() OVERRIDE { |
| 42 return &factory_; | 42 return &factory_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 virtual bool ShouldUseProcessPerSite(Profile* profile, |
| 46 const GURL& url) OVERRIDE { |
| 47 return false; |
| 48 } |
| 49 |
| 45 virtual bool IsURLSameAsAnySiteInstance(const GURL& url) OVERRIDE { | 50 virtual bool IsURLSameAsAnySiteInstance(const GURL& url) OVERRIDE { |
| 46 return url == GURL(kSameAsAnyInstanceURL) || | 51 return url == GURL(kSameAsAnyInstanceURL) || |
| 47 url == GURL(chrome::kAboutCrashURL); | 52 url == GURL(chrome::kAboutCrashURL); |
| 48 } | 53 } |
| 49 | 54 |
| 50 virtual GURL GetEffectiveURL(Profile* profile, const GURL& url) OVERRIDE { | 55 virtual GURL GetEffectiveURL(Profile* profile, const GURL& url) OVERRIDE { |
| 51 return url; | 56 return url; |
| 52 } | 57 } |
| 53 | 58 |
| 54 private: | 59 private: |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 GURL("chrome-extension://baz/bar"))); | 578 GURL("chrome-extension://baz/bar"))); |
| 574 EXPECT_EQ(s5a, s5b); | 579 EXPECT_EQ(s5a, s5b); |
| 575 | 580 |
| 576 // The derived profiles with the different sites. | 581 // The derived profiles with the different sites. |
| 577 scoped_refptr<SiteInstance> s6a(instance1->GetSiteInstanceForURL( | 582 scoped_refptr<SiteInstance> s6a(instance1->GetSiteInstanceForURL( |
| 578 GURL("chrome-extension://baz/bar"))); | 583 GURL("chrome-extension://baz/bar"))); |
| 579 scoped_refptr<SiteInstance> s6b(instance3->GetSiteInstanceForURL( | 584 scoped_refptr<SiteInstance> s6b(instance3->GetSiteInstanceForURL( |
| 580 GURL("chrome-extension://foo/boo"))); | 585 GURL("chrome-extension://foo/boo"))); |
| 581 EXPECT_NE(s6a, s6b); | 586 EXPECT_NE(s6a, s6b); |
| 582 } | 587 } |
| OLD | NEW |