Index: third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc |
diff --git a/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc b/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc |
index 9da2183716466c069f88cca0b7cf39a6d7164a03..6e2962a8606aed05a40a826c4dd365f7c7d03340 100644 |
--- a/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc |
+++ b/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc |
@@ -8,6 +8,7 @@ |
#include "net/url_request/test_url_fetcher_factory.h" |
#include "net/url_request/url_request_test_util.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "third_party/libaddressinput/src/cpp/include/libaddressinput/callback.h" |
namespace autofill { |
@@ -35,33 +36,31 @@ class ChromeDownloaderImplTest : public testing::Test { |
net::TestURLRequestContextGetter* getter = |
new net::TestURLRequestContextGetter(base::MessageLoopProxy::current()); |
ChromeDownloaderImpl impl(getter); |
- impl.Download(url_.spec(), BuildCallback()); |
+ scoped_ptr< ::i18n::addressinput::Downloader::Callback> callback( |
+ ::i18n::addressinput::BuildCallback( |
+ this, &ChromeDownloaderImplTest::OnDownloaded)); |
+ impl.Download(url_.spec(), *callback); |
base::MessageLoop::current()->RunUntilIdle(); |
} |
void set_url(const GURL& url) { url_ = url; } |
- const std::string& data() { return *data_; } |
+ const std::string& data() { return data_; } |
bool success() { return success_; } |
private: |
- scoped_ptr<ChromeDownloaderImpl::Callback> BuildCallback() { |
- return ::i18n::addressinput::BuildScopedPtrCallback( |
- this, &ChromeDownloaderImplTest::OnDownloaded); |
- } |
- |
// Callback for when download is finished. |
void OnDownloaded(bool success, |
const std::string& url, |
- scoped_ptr<std::string> data) { |
+ const std::string& data) { |
success_ = success; |
- data_ = data.Pass(); |
+ data_ = data; |
} |
base::MessageLoop loop_; |
net::URLFetcherImplFactory factory_; |
net::FakeURLFetcherFactory fake_factory_; |
GURL url_; |
- scoped_ptr<std::string> data_; |
+ std::string data_; |
bool success_; |
}; |