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

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler_unittest.cc

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 profile_ = builder.Build(); 228 profile_ = builder.Build();
229 signin_manager_ = static_cast<gcm::FakeSigninManager*>( 229 signin_manager_ = static_cast<gcm::FakeSigninManager*>(
230 SigninManagerFactory::GetInstance()->GetForProfile(profile_.get())); 230 SigninManagerFactory::GetInstance()->GetForProfile(profile_.get()));
231 231
232 // Create extension service in order to uninstall the extension. 232 // Create extension service in order to uninstall the extension.
233 TestExtensionSystem* extension_system( 233 TestExtensionSystem* extension_system(
234 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile()))); 234 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile())));
235 base::FilePath extensions_install_dir = 235 base::FilePath extensions_install_dir =
236 temp_dir_.path().Append(FILE_PATH_LITERAL("Extensions")); 236 temp_dir_.path().Append(FILE_PATH_LITERAL("Extensions"));
237 extension_system->CreateExtensionService( 237 extension_system->CreateExtensionService(
238 CommandLine::ForCurrentProcess(), extensions_install_dir, false); 238 base::CommandLine::ForCurrentProcess(), extensions_install_dir, false);
239 extension_service_ = extension_system->Get(profile())->extension_service(); 239 extension_service_ = extension_system->Get(profile())->extension_service();
240 extension_service_->set_extensions_enabled(true); 240 extension_service_->set_extensions_enabled(true);
241 extension_service_->set_show_extensions_prompts(false); 241 extension_service_->set_show_extensions_prompts(false);
242 extension_service_->set_install_updates_when_idle_for_test(false); 242 extension_service_->set_install_updates_when_idle_for_test(false);
243 243
244 // Enable GCM such that tests could be run on all channels. 244 // Enable GCM such that tests could be run on all channels.
245 profile()->GetPrefs()->SetBoolean(prefs::kGCMChannelEnabled, true); 245 profile()->GetPrefs()->SetBoolean(prefs::kGCMChannelEnabled, true);
246 246
247 // Create GCMProfileService that talks with fake GCMClient. 247 // Create GCMProfileService that talks with fake GCMClient.
248 gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse( 248 gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse(
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 // App handler is removed when the extension is updated to the version that 485 // App handler is removed when the extension is updated to the version that
486 // has GCM permission removed. 486 // has GCM permission removed.
487 UpdateExtension(extension.get(), "good2.crx"); 487 UpdateExtension(extension.get(), "good2.crx");
488 waiter()->PumpUILoop(); 488 waiter()->PumpUILoop();
489 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); 489 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero());
490 EXPECT_FALSE(HasAppHandlers(extension->id())); 490 EXPECT_FALSE(HasAppHandlers(extension->id()));
491 } 491 }
492 492
493 } // namespace extensions 493 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698