Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: content/browser/site_instance_unittest.cc

Issue 6693054: Get rid of extensions dependency from content\browser. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/site_instance.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/stl_util-inl.h" 5 #include "base/stl_util-inl.h"
6 #include "base/string16.h" 6 #include "base/string16.h"
7 #include "chrome/browser/renderer_host/browser_render_process_host.h" 7 #include "chrome/browser/renderer_host/browser_render_process_host.h"
8 #include "chrome/common/chrome_constants.h" 8 #include "chrome/common/chrome_constants.h"
9 #include "chrome/common/render_messages.h" 9 #include "chrome/common/render_messages.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 virtual content::WebUIFactory* GetWebUIFactory() { 43 virtual content::WebUIFactory* GetWebUIFactory() {
44 return &factory_; 44 return &factory_;
45 } 45 }
46 46
47 private: 47 private:
48 SiteInstanceTestWebUIFactory factory_; 48 SiteInstanceTestWebUIFactory factory_;
49 }; 49 };
50 50
51 class SiteInstanceTest : public testing::Test { 51 class SiteInstanceTest : public testing::Test {
52 public: 52 public:
53 SiteInstanceTest() : old_browser_client_(NULL) {
54 }
55
53 virtual void SetUp() { 56 virtual void SetUp() {
57 old_browser_client_ = content::GetContentClient()->browser();
54 content::GetContentClient()->set_browser(&browser_client_); 58 content::GetContentClient()->set_browser(&browser_client_);
55 } 59 }
56 60
61 virtual void TearDown() {
62 content::GetContentClient()->set_browser(old_browser_client_);
63 }
64
57 private: 65 private:
58 MessageLoopForUI message_loop_; 66 MessageLoopForUI message_loop_;
59 67
60 SiteInstanceTestBrowserClient browser_client_; 68 SiteInstanceTestBrowserClient browser_client_;
69 content::ContentBrowserClient* old_browser_client_;
61 }; 70 };
62 71
63 class TestBrowsingInstance : public BrowsingInstance { 72 class TestBrowsingInstance : public BrowsingInstance {
64 public: 73 public:
65 TestBrowsingInstance(Profile* profile, int* deleteCounter) 74 TestBrowsingInstance(Profile* profile, int* deleteCounter)
66 : BrowsingInstance(profile), 75 : BrowsingInstance(profile),
67 use_process_per_site(false), 76 use_process_per_site(false),
68 deleteCounter_(deleteCounter) { 77 deleteCounter_(deleteCounter) {
69 } 78 }
70 79
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 GURL("chrome-extension://baz/bar"))); 565 GURL("chrome-extension://baz/bar")));
557 EXPECT_EQ(s5a, s5b); 566 EXPECT_EQ(s5a, s5b);
558 567
559 // The derived profiles with the different sites. 568 // The derived profiles with the different sites.
560 scoped_refptr<SiteInstance> s6a(instance1->GetSiteInstanceForURL( 569 scoped_refptr<SiteInstance> s6a(instance1->GetSiteInstanceForURL(
561 GURL("chrome-extension://baz/bar"))); 570 GURL("chrome-extension://baz/bar")));
562 scoped_refptr<SiteInstance> s6b(instance3->GetSiteInstanceForURL( 571 scoped_refptr<SiteInstance> s6b(instance3->GetSiteInstanceForURL(
563 GURL("chrome-extension://foo/boo"))); 572 GURL("chrome-extension://foo/boo")));
564 EXPECT_NE(s6a, s6b); 573 EXPECT_NE(s6a, s6b);
565 } 574 }
OLDNEW
« no previous file with comments | « content/browser/site_instance.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698