| Index: chrome/browser/component_updater/test/component_updater_service_unittest.cc
|
| diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.cc b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
|
| index 10a30ecae8c4dbfff886972b68dbd98081d6d671..310a3180135c725ba9ce198147755dd0826a97a0 100644
|
| --- a/chrome/browser/component_updater/test/component_updater_service_unittest.cc
|
| +++ b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
|
| @@ -245,8 +245,7 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) {
|
| io_thread.StartIOThread();
|
| file_thread.Start();
|
|
|
| - scoped_refptr<ComponentUpdateInterceptor>
|
| - interceptor(new ComponentUpdateInterceptor());
|
| + ComponentUpdateInterceptor interceptor;
|
|
|
| CrxComponent com;
|
| RegisterComponent(&com, kTestComponent_abag, Version("1.1"));
|
| @@ -255,9 +254,9 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) {
|
| "http://localhost/upd?extra=foo&x=id%3D"
|
| "abagagagagagagagagagagagagagagag%26v%3D1.1%26uc";
|
|
|
| - interceptor->SetResponse(expected_update_url,
|
| - header_ok_reply,
|
| - test_file("updatecheck_reply_1.xml"));
|
| + interceptor.SetResponse(expected_update_url,
|
| + header_ok_reply,
|
| + test_file("updatecheck_reply_1.xml"));
|
|
|
| // We loop twice, but there are no updates so we expect two sleep messages.
|
| test_configurator()->SetLoopCount(2);
|
| @@ -274,7 +273,7 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) {
|
| EXPECT_EQ(chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, ev2.type);
|
| TestNotificationTracker::Event ev3 = notification_tracker().at(2);
|
| EXPECT_EQ(chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, ev2.type);
|
| - EXPECT_EQ(2, interceptor->hit_count());
|
| + EXPECT_EQ(2, interceptor.GetHitCount());
|
|
|
| EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error());
|
| EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count());
|
| @@ -284,9 +283,9 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) {
|
| // Loop twice again but this case we simulate a server error by returning
|
| // an empty file.
|
|
|
| - interceptor->SetResponse(expected_update_url,
|
| - header_ok_reply,
|
| - test_file("updatecheck_reply_empty"));
|
| + interceptor.SetResponse(expected_update_url,
|
| + header_ok_reply,
|
| + test_file("updatecheck_reply_empty"));
|
|
|
| notification_tracker().Reset();
|
| test_configurator()->SetLoopCount(2);
|
| @@ -301,7 +300,7 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) {
|
| EXPECT_EQ(chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, ev2.type);
|
| ev3 = notification_tracker().at(2);
|
| EXPECT_EQ(chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, ev2.type);
|
| - EXPECT_EQ(4, interceptor->hit_count());
|
| + EXPECT_EQ(4, interceptor.GetHitCount());
|
|
|
| EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error());
|
| EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count());
|
| @@ -326,8 +325,7 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
|
| io_thread.StartIOThread();
|
| file_thread.Start();
|
|
|
| - scoped_refptr<ComponentUpdateInterceptor>
|
| - interceptor(new ComponentUpdateInterceptor());
|
| + ComponentUpdateInterceptor interceptor;
|
|
|
| CrxComponent com1;
|
| RegisterComponent(&com1, kTestComponent_jebg, Version("0.9"));
|
| @@ -344,12 +342,12 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
|
| "abagagagagagagagagagagagagagagag%26v%3D2.2%26uc&x=id%3D"
|
| "jebgalgnebhfojomionfpkfelancnnkf%26v%3D1.0%26uc";
|
|
|
| - interceptor->SetResponse(expected_update_url_1, header_ok_reply,
|
| - test_file("updatecheck_reply_1.xml"));
|
| - interceptor->SetResponse(expected_update_url_2, header_ok_reply,
|
| - test_file("updatecheck_reply_1.xml"));
|
| - interceptor->SetResponse(expected_crx_url, header_ok_reply,
|
| - test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"));
|
| + interceptor.SetResponse(expected_update_url_1, header_ok_reply,
|
| + test_file("updatecheck_reply_1.xml"));
|
| + interceptor.SetResponse(expected_update_url_2, header_ok_reply,
|
| + test_file("updatecheck_reply_1.xml"));
|
| + interceptor.SetResponse(expected_crx_url, header_ok_reply,
|
| + test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"));
|
|
|
| test_configurator()->SetLoopCount(2);
|
|
|
| @@ -358,7 +356,7 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
|
|
|
| EXPECT_EQ(0, static_cast<TestInstaller*>(com1.installer)->error());
|
| EXPECT_EQ(1, static_cast<TestInstaller*>(com1.installer)->install_count());
|
| - EXPECT_EQ(3, interceptor->hit_count());
|
| + EXPECT_EQ(3, interceptor.GetHitCount());
|
|
|
| ASSERT_EQ(5ul, notification_tracker().size());
|
|
|
| @@ -389,8 +387,7 @@ TEST_F(ComponentUpdaterTest, ProdVersionCheck) {
|
| io_thread.StartIOThread();
|
| file_thread.Start();
|
|
|
| - scoped_refptr<ComponentUpdateInterceptor>
|
| - interceptor(new ComponentUpdateInterceptor());
|
| + ComponentUpdateInterceptor interceptor;
|
|
|
| CrxComponent com;
|
| RegisterComponent(&com, kTestComponent_jebg, Version("0.9"));
|
| @@ -399,17 +396,17 @@ TEST_F(ComponentUpdaterTest, ProdVersionCheck) {
|
| "http://localhost/upd?extra=foo&x=id%3D"
|
| "jebgalgnebhfojomionfpkfelancnnkf%26v%3D0.9%26uc";
|
|
|
| - interceptor->SetResponse(expected_update_url,
|
| - header_ok_reply,
|
| - test_file("updatecheck_reply_2.xml"));
|
| - interceptor->SetResponse(expected_crx_url, header_ok_reply,
|
| - test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"));
|
| + interceptor.SetResponse(expected_update_url,
|
| + header_ok_reply,
|
| + test_file("updatecheck_reply_2.xml"));
|
| + interceptor.SetResponse(expected_crx_url, header_ok_reply,
|
| + test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"));
|
|
|
| test_configurator()->SetLoopCount(1);
|
| component_updater()->Start();
|
| message_loop.Run();
|
|
|
| - EXPECT_EQ(1, interceptor->hit_count());
|
| + EXPECT_EQ(1, interceptor.GetHitCount());
|
| EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error());
|
| EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count());
|
|
|
|
|