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(), |