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

Unified Diff: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc

Issue 10546083: Convert ProtocolHandlerRegistry to be a ProfileKeyedService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update ProtocolHandlerRegistry to be a ProfileKeyedService in lieu of a refcounted pointer. Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
index 83161e65bdb8c0bfcc5ba6a1725c26382cbffd18..86f09192d808101c32e14ad2ed9d842cbfc2835c 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
@@ -202,7 +202,7 @@ class ProtocolHandlerRegistryTest : public testing::Test {
FakeDelegate* delegate() const { return delegate_; }
TestingProfile* profile() const { return profile_.get(); }
PrefService* pref_service() const { return profile_->GetPrefs(); }
- ProtocolHandlerRegistry* registry() const { return registry_.get(); }
+ ProtocolHandlerRegistry* registry() const { return registry_; }
const ProtocolHandler& test_protocol_handler() const {
return test_protocol_handler_;
}
@@ -281,7 +281,7 @@ class ProtocolHandlerRegistryTest : public testing::Test {
FakeDelegate* delegate_;
scoped_ptr<TestingProfile> profile_;
- scoped_refptr<ProtocolHandlerRegistry> registry_;
+ ProtocolHandlerRegistry* registry_;
ProtocolHandler test_protocol_handler_;
};
@@ -659,9 +659,10 @@ TEST_F(ProtocolHandlerRegistryTest, TestMaybeCreateTaskWorksFromIOThread) {
ProtocolHandler ph1 = CreateProtocolHandler("mailto", "test1");
registry()->OnAcceptRegisterProtocolHandler(ph1);
GURL url("mailto:someone@something.com");
- scoped_refptr<ProtocolHandlerRegistry> r(registry());
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(MakeRequest, url, r));
+ base::Bind(MakeRequest,
+ url,
+ base::Unretained(registry_)));
MessageLoop::current()->Run();
}
@@ -676,11 +677,10 @@ TEST_F(ProtocolHandlerRegistryTest, TestIsHandledProtocolWorksOnIOThread) {
std::string scheme("mailto");
ProtocolHandler ph1 = CreateProtocolHandler(scheme, "test1");
registry()->OnAcceptRegisterProtocolHandler(ph1);
- scoped_refptr<ProtocolHandlerRegistry> r(registry());
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
- base::Bind(CheckIsHandled, scheme, true, r));
+ base::Bind(CheckIsHandled, scheme, true, base::Unretained(registry_)));
}
TEST_F(ProtocolHandlerRegistryTest, TestRemovingDefaultFallsBackToOldDefault) {
@@ -724,12 +724,11 @@ TEST_F(ProtocolHandlerRegistryTest, TestClearDefaultGetsPropagatedToIO) {
ProtocolHandler ph1 = CreateProtocolHandler(scheme, "test1");
registry()->OnAcceptRegisterProtocolHandler(ph1);
registry()->ClearDefault(scheme);
- scoped_refptr<ProtocolHandlerRegistry> r(registry());
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
- base::Bind(CheckIsHandled, scheme, false, r));
+ base::Bind(CheckIsHandled, scheme, false, base::Unretained(registry_)));
}
static void QuitUILoop() {

Powered by Google App Engine
This is Rietveld 408576698