| 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 <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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 308 } |
| 309 data_dir = data_dir.AppendASCII("extensions"); | 309 data_dir = data_dir.AppendASCII("extensions"); |
| 310 data_dir = data_dir.AppendASCII(update_crx); | 310 data_dir = data_dir.AppendASCII(update_crx); |
| 311 | 311 |
| 312 base::FilePath path = temp_dir_.path(); | 312 base::FilePath path = temp_dir_.path(); |
| 313 path = path.Append(data_dir.BaseName()); | 313 path = path.Append(data_dir.BaseName()); |
| 314 ASSERT_TRUE(base::CopyFile(data_dir, path)); | 314 ASSERT_TRUE(base::CopyFile(data_dir, path)); |
| 315 | 315 |
| 316 extensions::CrxInstaller* installer = NULL; | 316 extensions::CrxInstaller* installer = NULL; |
| 317 content::WindowedNotificationObserver observer( | 317 content::WindowedNotificationObserver observer( |
| 318 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 318 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
| 319 base::Bind(&IsCrxInstallerDone, &installer)); | 319 base::Bind(&IsCrxInstallerDone, &installer)); |
| 320 extension_service_->UpdateExtension( | 320 extension_service_->UpdateExtension( |
| 321 extension->id(), path, true, &installer); | 321 extension->id(), path, true, &installer); |
| 322 | 322 |
| 323 if (installer) | 323 if (installer) |
| 324 observer.Wait(); | 324 observer.Wait(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 void DisableExtension(const Extension* extension) { | 327 void DisableExtension(const Extension* extension) { |
| 328 extension_service_->DisableExtension( | 328 extension_service_->DisableExtension( |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 488 |
| 489 // 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 |
| 490 // has GCM permission removed. | 490 // has GCM permission removed. |
| 491 UpdateExtension(extension, "good2.crx"); | 491 UpdateExtension(extension, "good2.crx"); |
| 492 waiter()->PumpUILoop(); | 492 waiter()->PumpUILoop(); |
| 493 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); | 493 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); |
| 494 EXPECT_FALSE(HasAppHandlers(extension->id())); | 494 EXPECT_FALSE(HasAppHandlers(extension->id())); |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace extensions | 497 } // namespace extensions |
| OLD | NEW |