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

Unified Diff: chrome_frame/test/chrome_frame_unittests.cc

Issue 386014: The ChromeFrameAutomationClient class needs to be refcounted as it implements... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « chrome_frame/test/chrome_frame_automation_mock.h ('k') | chrome_frame/urlmon_url_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/chrome_frame_unittests.cc
===================================================================
--- chrome_frame/test/chrome_frame_unittests.cc (revision 31733)
+++ chrome_frame/test/chrome_frame_unittests.cc (working copy)
@@ -901,8 +901,8 @@
int timeout = 0; // Chrome cannot send Hello message so fast.
const std::wstring profile = L"Adam.N.Epilinter";
- scoped_ptr<ChromeFrameAutomationClient> client;
- client.reset(new ChromeFrameAutomationClient());
+ scoped_refptr<ChromeFrameAutomationClient> client;
+ client = new ChromeFrameAutomationClient();
EXPECT_CALL(cfd, OnAutomationServerLaunchFailed(AUTOMATION_TIMEOUT,
testing::_))
@@ -924,8 +924,8 @@
const std::wstring profile = L"Adam.N.Epilinter";
int timeout = 10000;
- scoped_ptr<ChromeFrameAutomationClient> client;
- client.reset(new ChromeFrameAutomationClient);
+ scoped_refptr<ChromeFrameAutomationClient> client;
+ client = new ChromeFrameAutomationClient;
EXPECT_CALL(cfd, OnAutomationServerReady())
.Times(1)
@@ -938,7 +938,7 @@
loop.RunFor(11);
client->Uninitialize();
- client.reset(NULL);
+ client = NULL;
}
MATCHER_P(MsgType, msg_type, "IPC::Message::type()") {
@@ -960,8 +960,8 @@
const std::string url = "about:version";
int timeout = 10000;
- scoped_ptr<ChromeFrameAutomationClient> client;
- client.reset(new ChromeFrameAutomationClient);
+ scoped_refptr<ChromeFrameAutomationClient> client;
+ client = new ChromeFrameAutomationClient;
EXPECT_CALL(cfd, OnAutomationServerReady())
.WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor(
@@ -989,7 +989,7 @@
EXPECT_TRUE(client->Initialize(&cfd, timeout, false, profile, L"", false));
loop.RunFor(10);
client->Uninitialize();
- client.reset(NULL);
+ client = NULL;
}
// Bug: http://b/issue?id=2033644
@@ -1000,8 +1000,8 @@
const std::string url = "http://127.0.0.3:65412/";
int timeout = 10000;
- scoped_ptr<ChromeFrameAutomationClient> client;
- client.reset(new ChromeFrameAutomationClient);
+ scoped_refptr<ChromeFrameAutomationClient> client;
+ client = new ChromeFrameAutomationClient;
EXPECT_CALL(cfd, OnAutomationServerReady())
.WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor(
@@ -1025,7 +1025,7 @@
loop.RunFor(10);
client->Uninitialize();
- client.reset(NULL);
+ client = NULL;
}
MATCHER_P(EqURLRequest, x, "IPC::AutomationURLRequest matcher") {
@@ -1056,8 +1056,8 @@
const std::string url = "http://bongo.com";
int timeout = 10000;
- scoped_ptr<ChromeFrameAutomationClient> client;
- client.reset(new ChromeFrameAutomationClient);
+ scoped_refptr<ChromeFrameAutomationClient> client;
+ client = new ChromeFrameAutomationClient;
client->set_use_chrome_network(false);
cfd.SetAutomationSender(client.get());
@@ -1131,7 +1131,7 @@
loop.RunFor(10);
client->Uninitialize();
- client.reset(NULL);
+ client = NULL;
}
@@ -1158,7 +1158,8 @@
scoped_ptr<AutomationHandleTracker> tracker_;
MockAutomationMessageSender dummy_sender_;
scoped_refptr<TabProxy> tab_;
- scoped_ptr<ChromeFrameAutomationClient> client_; // the victim of all tests
+ // the victim of all tests
+ scoped_refptr<ChromeFrameAutomationClient> client_;
std::wstring profile_;
int timeout_;
@@ -1210,7 +1211,7 @@
dummy_sender_.ForwardTo(&proxy_);
tracker_.reset(new AutomationHandleTracker(&dummy_sender_));
- client_.reset(new ChromeFrameAutomationClient);
+ client_ = new ChromeFrameAutomationClient;
client_->set_proxy_factory(&factory_);
}
};
« no previous file with comments | « chrome_frame/test/chrome_frame_automation_mock.h ('k') | chrome_frame/urlmon_url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698