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

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

Issue 14308002: Save memory in the downloads extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r195142 Created 7 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
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2f3152cb82d3ff9b35a3b92422601500730a5fbc..51823f6c29268b3873f8e89eabcc28ea3821af68 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
@@ -264,6 +264,25 @@ class DownloadExtensionTest : public ExtensionApiTest {
// testing incognito.
extension_ = LoadExtensionIncognito(test_data_dir_.AppendASCII(name));
CHECK(extension_);
+ content::WebContents* tab = chrome::AddSelectedTabWithURL(
+ current_browser(),
+ extension_->GetResourceURL("empty.html"),
+ content::PAGE_TRANSITION_LINK);
+ extensions::ExtensionSystem::Get(current_browser()->profile())->
+ event_router()->AddEventListener(
+ extensions::event_names::kOnDownloadCreated,
+ tab->GetRenderProcessHost(),
+ GetExtensionId());
+ extensions::ExtensionSystem::Get(current_browser()->profile())->
+ event_router()->AddEventListener(
+ extensions::event_names::kOnDownloadChanged,
+ tab->GetRenderProcessHost(),
+ GetExtensionId());
+ extensions::ExtensionSystem::Get(current_browser()->profile())->
+ event_router()->AddEventListener(
+ extensions::event_names::kOnDownloadErased,
+ tab->GetRenderProcessHost(),
+ GetExtensionId());
}
content::RenderProcessHost* AddFilenameDeterminer() {
@@ -884,6 +903,7 @@ bool ItemIsInterrupted(DownloadItem* item) {
IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
DownloadExtensionTest_Open) {
+ LoadExtension("downloads_split");
EXPECT_STREQ(download_extension_errors::kInvalidOperationError,
RunFunctionAndReturnError(
new DownloadsOpenFunction(),
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698