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

Unified Diff: chrome/browser/sync/test/integration/two_client_apps_sync_test.cc

Issue 229553003: Implement syncing of bookmark apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
index 79476f52bef3ce9e75ad141b397029a759261d44..c0eda2b98c591b2a59dc9f4e5c89e0ee7c7f3b54 100644
--- a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
@@ -3,6 +3,9 @@
// found in the LICENSE file.
#include "base/basictypes.h"
+#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/extensions/bookmark_app_helper.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -12,8 +15,11 @@
#include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/common/extensions/extension_constants.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/test/test_utils.h"
#include "extensions/browser/app_sorting.h"
#include "extensions/browser/extension_prefs.h"
+#include "extensions/browser/extension_registry.h"
#include "sync/api/string_ordinal.h"
using apps_helper::AllProfilesHaveSameAppsAsVerifier;
@@ -505,6 +511,50 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UnexpectedLaunchType) {
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
+IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, BookmarkApp) {
+ ASSERT_TRUE(SetupSync());
+ ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
+
+ EXPECT_EQ(4u, GetProfile(0)->GetExtensionService()->extensions()->size());
+ EXPECT_EQ(4u, verifier()->GetExtensionService()->extensions()->size());
+ WebApplicationInfo web_app_info;
+ web_app_info.app_url = GURL("http://www.chromium.org");
+ web_app_info.title = base::UTF8ToUTF16("Test name");
+ web_app_info.description = base::UTF8ToUTF16("Test description");
+ {
+ content::WindowedNotificationObserver windowed_observer(
+ chrome::NOTIFICATION_CRX_INSTALLER_DONE,
+ content::NotificationService::AllSources());
+ extensions::CreateOrUpdateBookmarkApp(GetProfile(0)->GetExtensionService(),
+ web_app_info);
+ windowed_observer.Wait();
+ EXPECT_EQ(5u,
+ extensions::ExtensionRegistry::Get(GetProfile(0))
+ ->enabled_extensions()
+ .size());
+ }
+ {
+ content::WindowedNotificationObserver windowed_observer(
+ chrome::NOTIFICATION_CRX_INSTALLER_DONE,
+ content::NotificationService::AllSources());
+ extensions::CreateOrUpdateBookmarkApp(verifier()->GetExtensionService(),
+ web_app_info);
+ windowed_observer.Wait();
+ EXPECT_EQ(5u,
+ extensions::ExtensionRegistry::Get(verifier())
+ ->enabled_extensions()
+ .size());
+ }
+ {
+ // Wait for the synced app to install.
+ content::WindowedNotificationObserver windowed_observer(
+ chrome::NOTIFICATION_CRX_INSTALLER_DONE,
+ content::NotificationService::AllSources());
+ ASSERT_TRUE(AwaitQuiescence());
+ windowed_observer.Wait();
+ ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
+ }
+}
// TODO(akalin): Add tests exercising:
// - Offline installation/uninstallation behavior
// - App-specific properties

Powered by Google App Engine
This is Rietveld 408576698