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

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

Issue 280853004: Use EventRouter::Get instead of ExtensionSystem::Get(browser_context)->event_router() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and remove change(which is not in commit description) Created 6 years, 7 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_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 bf3e7e42136a28d465baab993afc682932040dec..0685b63da8430b7d90bc5f9926782a37cc87d231 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
@@ -63,9 +63,8 @@ using content::URLRequestSlowDownloadJob;
namespace errors = download_extension_errors;
-namespace downloads = extensions::api::downloads;
-
namespace extensions {
+namespace downloads = api::downloads;
namespace {
@@ -276,15 +275,15 @@ class DownloadExtensionTest : public ExtensionApiTest {
current_browser(),
extension_->GetResourceURL("empty.html"),
content::PAGE_TRANSITION_LINK);
- extensions::EventRouter::Get(current_browser()->profile())
+ EventRouter::Get(current_browser()->profile())
->AddEventListener(downloads::OnCreated::kEventName,
tab->GetRenderProcessHost(),
GetExtensionId());
- extensions::EventRouter::Get(current_browser()->profile())
+ EventRouter::Get(current_browser()->profile())
->AddEventListener(downloads::OnChanged::kEventName,
tab->GetRenderProcessHost(),
GetExtensionId());
- extensions::EventRouter::Get(current_browser()->profile())
+ EventRouter::Get(current_browser()->profile())
->AddEventListener(downloads::OnErased::kEventName,
tab->GetRenderProcessHost(),
GetExtensionId());
@@ -297,8 +296,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
current_browser(),
extension_->GetResourceURL("empty.html"),
content::PAGE_TRANSITION_LINK);
- extensions::ExtensionSystem::Get(current_browser()->profile())
- ->event_router()
+ EventRouter::Get(current_browser()->profile())
->AddEventListener(downloads::OnDeterminingFilename::kEventName,
tab->GetRenderProcessHost(),
GetExtensionId());
@@ -306,11 +304,8 @@ class DownloadExtensionTest : public ExtensionApiTest {
}
void RemoveFilenameDeterminer(content::RenderProcessHost* host) {
- extensions::ExtensionSystem::Get(current_browser()->profile())
- ->event_router()
- ->RemoveEventListener(downloads::OnDeterminingFilename::kEventName,
- host,
- GetExtensionId());
+ EventRouter::Get(current_browser()->profile())->RemoveEventListener(
+ downloads::OnDeterminingFilename::kEventName, host, GetExtensionId());
}
Browser* current_browser() { return current_browser_; }
@@ -603,7 +598,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
}
base::ScopedTempDir downloads_directory_;
- const extensions::Extension* extension_;
+ const Extension* extension_;
Browser* incognito_browser_;
Browser* current_browser_;
scoped_ptr<DownloadsEventsListener> events_listener_;
@@ -4038,7 +4033,7 @@ TEST(ExtensionDetermineDownloadFilenameInternal,
base::FilePath filename;
downloads::FilenameConflictAction conflict_action =
downloads::FILENAME_CONFLICT_ACTION_UNIQUIFY;
- extensions::ExtensionWarningSet warnings;
+ ExtensionWarningSet warnings;
// Empty incumbent determiner
warnings.clear();
@@ -4075,7 +4070,7 @@ TEST(ExtensionDetermineDownloadFilenameInternal,
EXPECT_EQ(FILE_PATH_LITERAL("a"), filename.value());
EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_OVERWRITE, conflict_action);
EXPECT_FALSE(warnings.empty());
- EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict,
+ EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict,
warnings.begin()->warning_type());
EXPECT_EQ("suggester", warnings.begin()->extension_id());
@@ -4096,7 +4091,7 @@ TEST(ExtensionDetermineDownloadFilenameInternal,
EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value());
EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action);
EXPECT_FALSE(warnings.empty());
- EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict,
+ EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict,
warnings.begin()->warning_type());
EXPECT_EQ("incumbent", warnings.begin()->extension_id());
}
« 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