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

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

Issue 12089051: Revert 179271 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "content/browser/browser_thread_impl.h" 9 #include "content/browser/browser_thread_impl.h"
10 #include "content/browser/browsing_instance.h" 10 #include "content/browser/browsing_instance.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 }; 56 };
57 57
58 class SiteInstanceTestBrowserClient : public TestContentBrowserClient { 58 class SiteInstanceTestBrowserClient : public TestContentBrowserClient {
59 public: 59 public:
60 SiteInstanceTestBrowserClient() 60 SiteInstanceTestBrowserClient()
61 : privileged_process_id_(-1) { 61 : privileged_process_id_(-1) {
62 WebUIControllerFactory::RegisterFactory(&factory_); 62 WebUIControllerFactory::RegisterFactory(&factory_);
63 } 63 }
64 64
65 ~SiteInstanceTestBrowserClient() { 65 ~SiteInstanceTestBrowserClient() {
66 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); 66 WebUIControllerFactoryRegistry::UnregisterFactoryForTesting(&factory_);
67 } 67 }
68 68
69 virtual bool IsSuitableHost(RenderProcessHost* process_host, 69 virtual bool IsSuitableHost(RenderProcessHost* process_host,
70 const GURL& site_url) OVERRIDE { 70 const GURL& site_url) OVERRIDE {
71 return (privileged_process_id_ == process_host->GetID()) == 71 return (privileged_process_id_ == process_host->GetID()) ==
72 site_url.SchemeIs(kPrivilegedScheme); 72 site_url.SchemeIs(kPrivilegedScheme);
73 } 73 }
74 74
75 void set_privileged_process_id(int process_id) { 75 void set_privileged_process_id(int process_id) {
76 privileged_process_id_ = process_id; 76 privileged_process_id_ = process_id;
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 EXPECT_FALSE(instance->HasWrongProcessForURL(GURL("http://evernote.com"))); 693 EXPECT_FALSE(instance->HasWrongProcessForURL(GURL("http://evernote.com")));
694 EXPECT_FALSE(instance->HasWrongProcessForURL( 694 EXPECT_FALSE(instance->HasWrongProcessForURL(
695 GURL("javascript:alert(document.location.href);"))); 695 GURL("javascript:alert(document.location.href);")));
696 696
697 EXPECT_TRUE(instance->HasWrongProcessForURL(GURL("chrome://settings"))); 697 EXPECT_TRUE(instance->HasWrongProcessForURL(GURL("chrome://settings")));
698 698
699 DrainMessageLoops(); 699 DrainMessageLoops();
700 } 700 }
701 701
702 } // namespace content 702 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/data/webui/print_preview.cc ('k') | content/browser/web_contents/render_view_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698