| 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() {
|
|
|