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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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/extensions/api/downloads/downloads_api_browsertest.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
index 5b5dbcd17b5bcd8906d90948e62d436aaefce24b..d49d9333b797766669ca1934d025177b8afcf264 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
@@ -168,7 +168,7 @@ class DownloadsEventsListener : public content::NotificationObserver {
Profile* profile_;
std::string event_name_;
std::string json_args_;
- scoped_ptr<base::Value> args_;
+ std::unique_ptr<base::Value> args_;
base::Time caught_;
DISALLOW_COPY_AND_ASSIGN(Event);
@@ -237,7 +237,7 @@ class DownloadsEventsListener : public content::NotificationObserver {
private:
bool waiting_;
base::Time last_wait_;
- scoped_ptr<Event> waiting_for_;
+ std::unique_ptr<Event> waiting_for_;
content::NotificationRegistrar registrar_;
std::deque<Event*> events_;
@@ -316,7 +316,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
// InProcessBrowserTest
void SetUpOnMainThread() override {
base::FeatureList::ClearInstanceForTesting();
- scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
feature_list->InitializeFromCommandLine(
features::kDownloadResumption.name, std::string());
base::FeatureList::SetInstance(std::move(feature_list));
@@ -459,7 +459,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
void CreateSlowTestDownloads(
size_t count, DownloadManager::DownloadVector* items) {
for (size_t i = 0; i < count; ++i) {
- scoped_ptr<content::DownloadTestObserver> observer(
+ std::unique_ptr<content::DownloadTestObserver> observer(
CreateInProgressDownloadObserver(1));
GURL slow_download_url(net::URLRequestSlowDownloadJob::kUnknownSizeUrl);
ui_test_utils::NavigateToURL(current_browser(), slow_download_url);
@@ -472,7 +472,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
}
DownloadItem* CreateSlowTestDownload() {
- scoped_ptr<content::DownloadTestObserver> observer(
+ std::unique_ptr<content::DownloadTestObserver> observer(
CreateInProgressDownloadObserver(1));
GURL slow_download_url(net::URLRequestSlowDownloadJob::kUnknownSizeUrl);
DownloadManager* manager = GetCurrentManager();
@@ -503,7 +503,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
}
void FinishPendingSlowDownloads() {
- scoped_ptr<content::DownloadTestObserver> observer(
+ std::unique_ptr<content::DownloadTestObserver> observer(
CreateDownloadObserver(1));
GURL finish_url(net::URLRequestSlowDownloadJob::kFinishDownloadUrl);
ui_test_utils::NavigateToURLWithDisposition(
@@ -568,7 +568,8 @@ class DownloadExtensionTest : public ExtensionApiTest {
const std::string& args,
std::string* result_string) {
SetUpExtensionFunction(function.get());
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(function, args));
+ std::unique_ptr<base::Value> result(
+ RunFunctionAndReturnResult(function, args));
EXPECT_TRUE(result.get());
return result.get() && result->GetAsString(result_string);
}
@@ -607,7 +608,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
const Extension* extension_;
Browser* incognito_browser_;
Browser* current_browser_;
- scoped_ptr<DownloadsEventsListener> events_listener_;
+ std::unique_ptr<DownloadsEventsListener> events_listener_;
DISALLOW_COPY_AND_ASSIGN(DownloadExtensionTest);
};
@@ -934,9 +935,8 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
EXPECT_STREQ(errors::kInvalidId, error.c_str());
int id = download_item->GetId();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsEraseFunction(),
- base::StringPrintf("[{\"id\": %d}]", id)));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsEraseFunction(), base::StringPrintf("[{\"id\": %d}]", id)));
DownloadManager::DownloadVector items;
GetCurrentManager()->GetAllDownloads(&items);
EXPECT_EQ(0UL, items.size());
@@ -1085,8 +1085,8 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ScopedCancellingItem item(CreateSlowTestDownload());
ASSERT_TRUE(item.get());
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsSearchFunction(), "[{}]"));
+ std::unique_ptr<base::Value> result(
+ RunFunctionAndReturnResult(new DownloadsSearchFunction(), "[{}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
ASSERT_TRUE(result->GetAsList(&result_list));
@@ -1108,7 +1108,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(CreateHistoryDownloads(kHistoryInfo, arraysize(kHistoryInfo),
&all_downloads));
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsSearchFunction(), "[{\"filenameRegex\": \"foobar\"}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
@@ -1135,9 +1135,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
CreateSlowTestDownloads(2, &items);
ScopedItemVectorCanceller delete_items(&items);
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsSearchFunction(), base::StringPrintf(
- "[{\"id\": %u}]", items[0]->GetId())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsSearchFunction(),
+ base::StringPrintf("[{\"id\": %u}]", items[0]->GetId())));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
ASSERT_TRUE(result->GetAsList(&result_list));
@@ -1163,9 +1163,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
CreateSlowTestDownloads(2, &items);
ScopedItemVectorCanceller delete_items(&items);
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsSearchFunction(),
- "[{\"id\": 0, \"filename\": \"foobar\"}]"));
+ std::unique_ptr<base::Value> result(
+ RunFunctionAndReturnResult(new DownloadsSearchFunction(),
+ "[{\"id\": 0, \"filename\": \"foobar\"}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
ASSERT_TRUE(result->GetAsList(&result_list));
@@ -1187,7 +1187,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(CreateHistoryDownloads(kHistoryInfo, arraysize(kHistoryInfo),
&items));
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsSearchFunction(), "[{\"orderBy\": [\"filename\"]}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
@@ -1220,7 +1220,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(CreateHistoryDownloads(kHistoryInfo, arraysize(kHistoryInfo),
&items));
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsSearchFunction(), "[{\"orderBy\": []}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
@@ -1257,7 +1257,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(CreateHistoryDownloads(kHistoryInfo, arraysize(kHistoryInfo),
&items));
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsSearchFunction(), "[{\"danger\": \"content\"}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
@@ -1281,7 +1281,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
items[0]->Cancel(true);
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsSearchFunction(), "[{\"state\": \"in_progress\"}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
@@ -1303,7 +1303,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
CreateSlowTestDownloads(2, &items);
ScopedItemVectorCanceller delete_items(&items);
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsSearchFunction(), "[{\"limit\": 1}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
@@ -1346,12 +1346,13 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(CreateHistoryDownloads(kHistoryInfo, arraysize(kHistoryInfo),
&items));
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsSearchFunction(), "[{"
- "\"state\": \"complete\", "
- "\"danger\": \"content\", "
- "\"orderBy\": [\"filename\"], "
- "\"limit\": 1}]"));
+ std::unique_ptr<base::Value> result(
+ RunFunctionAndReturnResult(new DownloadsSearchFunction(),
+ "[{"
+ "\"state\": \"complete\", "
+ "\"danger\": \"content\", "
+ "\"orderBy\": [\"filename\"], "
+ "\"limit\": 1}]"));
ASSERT_TRUE(result.get());
base::ListValue* result_list = NULL;
ASSERT_TRUE(result->GetAsList(&result_list));
@@ -1369,7 +1370,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
// DownloadsResumeFunction, and DownloadsCancelFunction.
IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito) {
- scoped_ptr<base::Value> result_value;
+ std::unique_ptr<base::Value> result_value;
base::ListValue* result_list = NULL;
base::DictionaryValue* result_dict = NULL;
base::FilePath::StringType filename;
@@ -1505,9 +1506,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
GoOnTheRecord();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -1550,9 +1551,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -1687,11 +1688,11 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"sub/dir/ect/ory.txt\"}]",
- download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"sub/dir/ect/ory.txt\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -1775,7 +1776,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
}
int result_id = -1;
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsDownloadFunction(),
"[{\"url\": \"javascript:document.write(\\\"hello\\\");\"}]"));
ASSERT_TRUE(result.get());
@@ -1824,9 +1825,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
embedded_test_server()->GetURL("/slow?0#fragment").spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -1867,9 +1868,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
std::string download_url = "data:text/plain,hello";
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -1946,10 +1947,11 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
std::string download_url = "data:text/plain,hello";
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"data.txt\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"data.txt\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2001,10 +2003,11 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
download_url += "C:/";
#endif
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"file.txt\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"file.txt\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2050,11 +2053,11 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
embedded_test_server()->GetURL("/auth-basic").spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"auth-basic-fail.txt\"}]",
- download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"auth-basic-fail.txt\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2086,14 +2089,14 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
.spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"headers-succeed.txt\","
- " \"headers\": ["
- " {\"name\": \"Foo\", \"value\": \"bar\"},"
- " {\"name\": \"Qx\", \"value\":\"yo\"}]}]",
- download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"headers-succeed.txt\","
+ " \"headers\": ["
+ " {\"name\": \"Foo\", \"value\": \"bar\"},"
+ " {\"name\": \"Qx\", \"value\":\"yo\"}]}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2143,11 +2146,11 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
.spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"headers-fail.txt\"}]",
- download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"headers-fail.txt\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2181,14 +2184,14 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
static const char kAuthorization[] = "dXNlcm5hbWU6c2VjcmV0";
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"auth-basic-succeed.txt\","
- " \"headers\": [{"
- " \"name\": \"Authorization\","
- " \"value\": \"Basic %s\"}]}]",
- download_url.c_str(), kAuthorization)));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"auth-basic-succeed.txt\","
+ " \"headers\": [{"
+ " \"name\": \"Authorization\","
+ " \"value\": \"Basic %s\"}]}]",
+ download_url.c_str(), kAuthorization)));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2228,13 +2231,13 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
.spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"filename\": \"post-succeed.txt\","
- " \"method\": \"POST\","
- " \"body\": \"BODY\"}]",
- download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"filename\": \"post-succeed.txt\","
+ " \"method\": \"POST\","
+ " \"body\": \"BODY\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2284,12 +2287,12 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
.spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"body\": \"BODY\","
- " \"filename\": \"post-get.txt\"}]",
- download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"body\": \"BODY\","
+ " \"filename\": \"post-get.txt\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2327,12 +2330,12 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
.spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\","
- " \"method\": \"POST\","
- " \"filename\": \"post-nobody.txt\"}]",
- download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\","
+ " \"method\": \"POST\","
+ " \"filename\": \"post-nobody.txt\"}]",
+ download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2367,9 +2370,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
spawned_test_server()->GetURL("download-known-size").spec();
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2428,9 +2431,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
strlen(kPayloadData)));
// Now download it.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2477,9 +2480,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2550,9 +2553,9 @@ IN_PROC_BROWSER_TEST_F(
0);
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2606,9 +2609,9 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2685,9 +2688,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2763,9 +2766,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2829,9 +2832,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2895,9 +2898,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -2968,9 +2971,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3034,9 +3037,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3100,9 +3103,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3166,9 +3169,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3233,9 +3236,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3301,9 +3304,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3427,9 +3430,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3563,9 +3566,9 @@ IN_PROC_BROWSER_TEST_F(
std::string download_url = embedded_test_server()->GetURL("/slow?0").spec();
// Start downloading a file.
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3619,9 +3622,9 @@ IN_PROC_BROWSER_TEST_F(
// Start an on-record download.
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3758,9 +3761,9 @@ IN_PROC_BROWSER_TEST_F(
// Start an on-record download.
GoOnTheRecord();
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
- new DownloadsDownloadFunction(), base::StringPrintf(
- "[{\"url\": \"%s\"}]", download_url.c_str())));
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
+ new DownloadsDownloadFunction(),
+ base::StringPrintf("[{\"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
@@ -3903,7 +3906,7 @@ IN_PROC_BROWSER_TEST_F(
DownloadItem* item = NULL;
{
DownloadManager* manager = GetCurrentManager();
- scoped_ptr<content::DownloadTestObserver> observer(
+ std::unique_ptr<content::DownloadTestObserver> observer(
new JustInProgressDownloadObserver(manager, 1));
ASSERT_EQ(0, manager->InProgressCount());
ASSERT_EQ(0, manager->NonMaliciousInProgressCount());
@@ -4064,7 +4067,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
// DownloadDangerPrompt is created, pretend that the user clicks the Accept
// button; wait until the download completes.
LoadExtension("downloads_split");
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult(
+ std::unique_ptr<base::Value> result(RunFunctionAndReturnResult(
new DownloadsDownloadFunction(),
"[{\"url\": \"data:,\", \"filename\": \"dangerous.swf\"}]"));
ASSERT_TRUE(result.get());
@@ -4081,7 +4084,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
result_id)));
ASSERT_TRUE(item->IsDangerous());
ScopedCancellingItem canceller(item);
- scoped_ptr<content::DownloadTestObserver> observer(
+ std::unique_ptr<content::DownloadTestObserver> observer(
new content::DownloadTestObserverTerminal(
GetCurrentManager(), 1,
content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_IGNORE));

Powered by Google App Engine
This is Rietveld 408576698