| OLD | NEW |
| 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 <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // Create extension service in order to uninstall the extension. | 259 // Create extension service in order to uninstall the extension. |
| 260 TestExtensionSystem* extension_system( | 260 TestExtensionSystem* extension_system( |
| 261 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile()))); | 261 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile()))); |
| 262 base::FilePath extensions_install_dir = | 262 base::FilePath extensions_install_dir = |
| 263 temp_dir_.path().Append(FILE_PATH_LITERAL("Extensions")); | 263 temp_dir_.path().Append(FILE_PATH_LITERAL("Extensions")); |
| 264 extension_system->CreateExtensionService( | 264 extension_system->CreateExtensionService( |
| 265 base::CommandLine::ForCurrentProcess(), extensions_install_dir, false); | 265 base::CommandLine::ForCurrentProcess(), extensions_install_dir, false); |
| 266 extension_service_ = extension_system->Get(profile())->extension_service(); | 266 extension_service_ = extension_system->Get(profile())->extension_service(); |
| 267 extension_service_->set_extensions_enabled(true); | 267 extension_service_->set_extensions_enabled(true); |
| 268 extension_service_->set_show_extensions_prompts(false); | 268 extension_service_->set_show_extensions_prompts(false); |
| 269 extension_service_->set_install_updates_when_idle_for_test(false); | |
| 270 | 269 |
| 271 // Create GCMProfileService that talks with fake GCMClient. | 270 // Create GCMProfileService that talks with fake GCMClient. |
| 272 gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 271 gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 273 profile(), &ExtensionGCMAppHandlerTest::BuildGCMProfileService); | 272 profile(), &ExtensionGCMAppHandlerTest::BuildGCMProfileService); |
| 274 | 273 |
| 275 // Create a fake version of ExtensionGCMAppHandler. | 274 // Create a fake version of ExtensionGCMAppHandler. |
| 276 gcm_app_handler_.reset(new FakeExtensionGCMAppHandler(profile(), &waiter_)); | 275 gcm_app_handler_.reset(new FakeExtensionGCMAppHandler(profile(), &waiter_)); |
| 277 } | 276 } |
| 278 | 277 |
| 279 void TearDown() override { | 278 void TearDown() override { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 488 |
| 490 // App handler is removed when the extension is updated to the version that | 489 // App handler is removed when the extension is updated to the version that |
| 491 // has GCM permission removed. | 490 // has GCM permission removed. |
| 492 UpdateExtension(extension.get(), "good2.crx"); | 491 UpdateExtension(extension.get(), "good2.crx"); |
| 493 waiter()->PumpUILoop(); | 492 waiter()->PumpUILoop(); |
| 494 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); | 493 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); |
| 495 EXPECT_FALSE(HasAppHandlers(extension->id())); | 494 EXPECT_FALSE(HasAppHandlers(extension->id())); |
| 496 } | 495 } |
| 497 | 496 |
| 498 } // namespace extensions | 497 } // namespace extensions |
| OLD | NEW |