OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/process_manager.h" | 5 #include "extensions/browser/process_manager.h" |
6 | 6 |
7 #include "content/public/browser/content_browser_client.h" | 7 #include "content/public/browser/content_browser_client.h" |
8 #include "content/public/browser/notification_service.h" | 8 #include "content/public/browser/notification_service.h" |
9 #include "content/public/browser/site_instance.h" | 9 #include "content/public/browser/site_instance.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // An incognito version of a TestBrowserContext. | 26 // An incognito version of a TestBrowserContext. |
27 class TestBrowserContextIncognito : public TestBrowserContext { | 27 class TestBrowserContextIncognito : public TestBrowserContext { |
28 public: | 28 public: |
29 TestBrowserContextIncognito() {} | 29 TestBrowserContextIncognito() {} |
30 virtual ~TestBrowserContextIncognito() {} | 30 virtual ~TestBrowserContextIncognito() {} |
31 | 31 |
32 // TestBrowserContext implementation. | 32 // TestBrowserContext implementation. |
33 virtual bool IsOffTheRecord() const OVERRIDE { return true; } | 33 virtual bool IsOffTheRecord() const override { return true; } |
34 | 34 |
35 private: | 35 private: |
36 DISALLOW_COPY_AND_ASSIGN(TestBrowserContextIncognito); | 36 DISALLOW_COPY_AND_ASSIGN(TestBrowserContextIncognito); |
37 }; | 37 }; |
38 | 38 |
39 // A trivial ProcessManagerDelegate. | 39 // A trivial ProcessManagerDelegate. |
40 class TestProcessManagerDelegate : public ProcessManagerDelegate { | 40 class TestProcessManagerDelegate : public ProcessManagerDelegate { |
41 public: | 41 public: |
42 TestProcessManagerDelegate() | 42 TestProcessManagerDelegate() |
43 : is_background_page_allowed_(true), | 43 : is_background_page_allowed_(true), |
44 defer_creating_startup_background_hosts_(false) {} | 44 defer_creating_startup_background_hosts_(false) {} |
45 virtual ~TestProcessManagerDelegate() {} | 45 virtual ~TestProcessManagerDelegate() {} |
46 | 46 |
47 // ProcessManagerDelegate implementation. | 47 // ProcessManagerDelegate implementation. |
48 virtual bool IsBackgroundPageAllowed(BrowserContext* context) const OVERRIDE { | 48 virtual bool IsBackgroundPageAllowed(BrowserContext* context) const override { |
49 return is_background_page_allowed_; | 49 return is_background_page_allowed_; |
50 } | 50 } |
51 virtual bool DeferCreatingStartupBackgroundHosts( | 51 virtual bool DeferCreatingStartupBackgroundHosts( |
52 BrowserContext* context) const OVERRIDE { | 52 BrowserContext* context) const override { |
53 return defer_creating_startup_background_hosts_; | 53 return defer_creating_startup_background_hosts_; |
54 } | 54 } |
55 | 55 |
56 bool is_background_page_allowed_; | 56 bool is_background_page_allowed_; |
57 bool defer_creating_startup_background_hosts_; | 57 bool defer_creating_startup_background_hosts_; |
58 }; | 58 }; |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 class ProcessManagerTest : public ExtensionsTest { | 62 class ProcessManagerTest : public ExtensionsTest { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 scoped_refptr<SiteInstance> site21 = | 254 scoped_refptr<SiteInstance> site21 = |
255 manager1->GetSiteInstanceForURL(ext2_url1); | 255 manager1->GetSiteInstanceForURL(ext2_url1); |
256 EXPECT_NE(site11, site21); | 256 EXPECT_NE(site11, site21); |
257 | 257 |
258 scoped_refptr<SiteInstance> other_profile_site = | 258 scoped_refptr<SiteInstance> other_profile_site = |
259 manager2->GetSiteInstanceForURL(ext1_url1); | 259 manager2->GetSiteInstanceForURL(ext1_url1); |
260 EXPECT_NE(site11, other_profile_site); | 260 EXPECT_NE(site11, other_profile_site); |
261 } | 261 } |
262 | 262 |
263 } // namespace extensions | 263 } // namespace extensions |
OLD | NEW |