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

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

Issue 10735089: DownloadManager::Observer::OnDownloadCreated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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_unittest.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
index bba9b21695994887a0ed7caed9314baa259b00b7..f909c14d2917f0bcb79bda281ff96dbe1b02d2ca 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
@@ -1476,12 +1476,10 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadCreated,
base::StringPrintf("[{\"danger\": \"safe\","
- " \"filename\": \"%s\","
" \"incognito\": false,"
" \"mime\": \"text/plain\","
" \"paused\": false,"
" \"url\": \"%s\"}]",
- GetFilename("slow.txt.crdownload").c_str(),
download_url.c_str())));
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadChanged,
base::StringPrintf("[{\"id\": %d,"
@@ -1519,12 +1517,10 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadCreated,
base::StringPrintf("[{\"danger\": \"safe\","
- " \"filename\": \"%s\","
" \"incognito\": true,"
" \"mime\": \"text/plain\","
" \"paused\": false,"
" \"url\": \"%s\"}]",
- GetFilename("slow.txt.crdownload").c_str(),
download_url.c_str())));
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadChanged,
base::StringPrintf("[{\"id\":%d,"
@@ -1675,12 +1671,10 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadCreated,
base::StringPrintf("[{\"danger\": \"safe\","
- " \"filename\": \"%s\","
" \"incognito\": false,"
" \"mime\": \"text/plain\","
" \"paused\": false,"
" \"url\": \"%s\"}]",
- GetFilename("slow.txt.crdownload").c_str(),
download_url.c_str())));
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadChanged,
base::StringPrintf("[{\"id\": %d,"
@@ -1718,12 +1712,10 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadCreated,
base::StringPrintf("[{\"danger\": \"safe\","
- " \"filename\": \"%s\","
" \"incognito\": false,"
" \"mime\": \"text/plain\","
" \"paused\": false,"
" \"url\": \"%s\"}]",
- GetFilename("data.txt.crdownload").c_str(),
download_url.c_str())));
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadChanged,
base::StringPrintf("[{\"id\": %d,"
@@ -1764,12 +1756,10 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadCreated,
base::StringPrintf("[{\"danger\": \"safe\","
- " \"filename\": \"%s\","
" \"incognito\": false,"
" \"mime\": \"text/html\","
" \"paused\": false,"
" \"url\": \"%s\"}]",
- GetFilename("file.txt.crdownload").c_str(),
download_url.c_str())));
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadChanged,
base::StringPrintf("[{\"id\": %d,"
@@ -1971,16 +1961,21 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadCreated,
base::StringPrintf("[{\"danger\": \"safe\","
- " \"incognito\": false,"
- " \"mime\": \"application/octet-stream\","
- " \"paused\": false,"
- " \"bytesReceived\": 164,"
- " \"url\": \"%s\"}]", download_url.c_str())));
+ " \"incognito\": false,"
+ " \"mime\": \"application/octet-stream\","
+ " \"paused\": false,"
+ " \"url\": \"%s\"}]", download_url.c_str())));
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadChanged,
base::StringPrintf("[{\"id\": %d,"
- " \"state\": {"
- " \"previous\": \"in_progress\","
- " \"current\": \"complete\"}}]", result_id)));
+ " \"state\": {"
+ " \"previous\": \"in_progress\","
+ " \"current\": \"complete\"},"
+ " \"filename\": {"
+ " \"previous\": \"%s\","
+ " \"current\": \"%s\"}}]",
+ result_id,
+ GetFilename("post-succeed.txt.crdownload").c_str(),
+ GetFilename("post-succeed.txt").c_str())));
}
// Test that downloadPostSuccess would fail if the resource requires the POST
@@ -2136,12 +2131,10 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadCreated,
base::StringPrintf("[{\"danger\": \"safe\","
- " \"filename\": \"%s\","
" \"incognito\": false,"
" \"mime\": \"text/plain\","
" \"paused\": false,"
" \"url\": \"%s\"}]",
- GetFilename("on_record.txt.crdownload").c_str(),
download_url.c_str())));
ASSERT_TRUE(WaitFor(extension_event_names::kOnDownloadChanged,
base::StringPrintf("[{\"id\": %d,"

Powered by Google App Engine
This is Rietveld 408576698