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

Unified Diff: chrome/browser/storage_monitor/storage_monitor_linux.cc

Issue 12912013: Storage Monitor Linux: Do not try to initialize MediaTransferProtocolManager during unit tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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/storage_monitor/storage_monitor_linux.cc
===================================================================
--- chrome/browser/storage_monitor/storage_monitor_linux.cc (revision 190492)
+++ chrome/browser/storage_monitor/storage_monitor_linux.cc (working copy)
@@ -275,7 +275,7 @@
StorageMonitorLinux::~StorageMonitorLinux() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
+ if (!IsRunningTest()) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&device::MediaTransferProtocolManager::Shutdown));
@@ -293,7 +293,7 @@
BrowserThread::FILE, FROM_HERE,
base::Bind(&StorageMonitorLinux::InitOnFileThread, this));
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
+ if (!IsRunningTest()) {
scoped_refptr<base::MessageLoopProxy> loop_proxy;
loop_proxy = content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::FILE);
@@ -346,6 +346,10 @@
UpdateMtab();
}
+bool StorageMonitorLinux::IsRunningTest() const {
+ return CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType);
+}
+
void StorageMonitorLinux::InitOnFileThread() {
DCHECK(!initialized_);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));

Powered by Google App Engine
This is Rietveld 408576698