OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/extensions/app_sync_data.h" | 8 #include "chrome/browser/extensions/app_sync_data.h" |
9 #include "chrome/browser/extensions/bookmark_app_helper.h" | 9 #include "chrome/browser/extensions/bookmark_app_helper.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 WebApplicationInfo web_app_info; | 436 WebApplicationInfo web_app_info; |
437 web_app_info.app_url = GURL("http://www.chromium.org"); | 437 web_app_info.app_url = GURL("http://www.chromium.org"); |
438 web_app_info.title = base::UTF8ToUTF16("Test name"); | 438 web_app_info.title = base::UTF8ToUTF16("Test name"); |
439 web_app_info.description = base::UTF8ToUTF16("Test description"); | 439 web_app_info.description = base::UTF8ToUTF16("Test description"); |
440 ++num_extensions; | 440 ++num_extensions; |
441 { | 441 { |
442 content::WindowedNotificationObserver windowed_observer( | 442 content::WindowedNotificationObserver windowed_observer( |
443 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 443 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
444 content::NotificationService::AllSources()); | 444 content::NotificationService::AllSources()); |
445 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(GetProfile(0)), | 445 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(GetProfile(0)), |
446 web_app_info); | 446 &web_app_info); |
447 windowed_observer.Wait(); | 447 windowed_observer.Wait(); |
448 EXPECT_EQ(num_extensions, | 448 EXPECT_EQ(num_extensions, |
449 GetExtensionRegistry(GetProfile(0))->enabled_extensions().size()); | 449 GetExtensionRegistry(GetProfile(0))->enabled_extensions().size()); |
450 } | 450 } |
451 { | 451 { |
452 content::WindowedNotificationObserver windowed_observer( | 452 content::WindowedNotificationObserver windowed_observer( |
453 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 453 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
454 content::NotificationService::AllSources()); | 454 content::NotificationService::AllSources()); |
455 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(verifier()), | 455 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(verifier()), |
456 web_app_info); | 456 &web_app_info); |
457 windowed_observer.Wait(); | 457 windowed_observer.Wait(); |
458 EXPECT_EQ(num_extensions, | 458 EXPECT_EQ(num_extensions, |
459 GetExtensionRegistry(verifier())->enabled_extensions().size()); | 459 GetExtensionRegistry(verifier())->enabled_extensions().size()); |
460 } | 460 } |
461 { | 461 { |
462 // Wait for the synced app to install. | 462 // Wait for the synced app to install. |
463 content::WindowedNotificationObserver windowed_observer( | 463 content::WindowedNotificationObserver windowed_observer( |
464 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 464 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
465 base::Bind(&AllProfilesHaveSameAppsAsVerifier)); | 465 base::Bind(&AllProfilesHaveSameAppsAsVerifier)); |
466 windowed_observer.Wait(); | 466 windowed_observer.Wait(); |
467 } | 467 } |
468 } | 468 } |
469 | 469 |
470 // TODO(akalin): Add tests exercising: | 470 // TODO(akalin): Add tests exercising: |
471 // - Offline installation/uninstallation behavior | 471 // - Offline installation/uninstallation behavior |
472 // - App-specific properties | 472 // - App-specific properties |
OLD | NEW |