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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 base::FilePath path = temp_dir_.path(); | 300 base::FilePath path = temp_dir_.path(); |
301 path = path.Append(data_dir.BaseName()); | 301 path = path.Append(data_dir.BaseName()); |
302 ASSERT_TRUE(base::CopyFile(data_dir, path)); | 302 ASSERT_TRUE(base::CopyFile(data_dir, path)); |
303 | 303 |
304 extensions::CrxInstaller* installer = NULL; | 304 extensions::CrxInstaller* installer = NULL; |
305 content::WindowedNotificationObserver observer( | 305 content::WindowedNotificationObserver observer( |
306 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 306 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
307 base::Bind(&IsCrxInstallerDone, &installer)); | 307 base::Bind(&IsCrxInstallerDone, &installer)); |
308 extension_service_->UpdateExtension( | 308 extension_service_->UpdateExtension( |
309 extension->id(), path, true, &installer); | 309 extensions::CRXFileInfo(extension->id(), path), true, &installer); |
310 | 310 |
311 if (installer) | 311 if (installer) |
312 observer.Wait(); | 312 observer.Wait(); |
313 } | 313 } |
314 | 314 |
315 void DisableExtension(const Extension* extension) { | 315 void DisableExtension(const Extension* extension) { |
316 extension_service_->DisableExtension( | 316 extension_service_->DisableExtension( |
317 extension->id(), Extension::DISABLE_USER_ACTION); | 317 extension->id(), Extension::DISABLE_USER_ACTION); |
318 } | 318 } |
319 | 319 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 462 |
463 // App handler is removed when the extension is updated to the version that | 463 // App handler is removed when the extension is updated to the version that |
464 // has GCM permission removed. | 464 // has GCM permission removed. |
465 UpdateExtension(extension.get(), "good2.crx"); | 465 UpdateExtension(extension.get(), "good2.crx"); |
466 waiter()->PumpUILoop(); | 466 waiter()->PumpUILoop(); |
467 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); | 467 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); |
468 EXPECT_FALSE(HasAppHandlers(extension->id())); | 468 EXPECT_FALSE(HasAppHandlers(extension->id())); |
469 } | 469 } |
470 | 470 |
471 } // namespace extensions | 471 } // namespace extensions |
OLD | NEW |