Make the Chrome Web Store Icon Syncable
Mark the CWS as a syncable app so that it page and app launch ordinals are synced. It also ensure that the CWS has valid ordinals as soon as it it added to the client, instead of waiting until the NTP is shown.
BUG=112290
TEST=Users should be able to move the Chrome Web store icon and have its positions update to other signed in locations.
Review URL: http://codereview.chromium.org/9340007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121310 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index e9b5354..be32898 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -69,6 +69,7 @@
#include "content/public/browser/plugin_service.h"
#include "content/test/test_browser_thread.h"
#include "googleurl/src/gurl.h"
+#include "grit/browser_resources.h"
#include "net/base/cookie_monster.h"
#include "net/base/cookie_options.h"
#include "net/url_request/url_request_context.h"
@@ -2037,6 +2038,21 @@
ASSERT_TRUE(new_launch_ordinal.Equal(sorting->GetAppLaunchOrdinal(id)));
}
+// Ensures that the CWS has properly initialized ordinals.
+TEST_F(ExtensionServiceTest, EnsureCWSOrdinalsInitialized) {
+ InitializeEmptyExtensionService();
+ service_->component_loader()->Add(IDR_WEBSTORE_MANIFEST,
+ FilePath(FILE_PATH_LITERAL("web_store")));
+ service_->Init();
+
+
+ ExtensionSorting* sorting = service_->extension_prefs()->extension_sorting();
+ EXPECT_TRUE(
+ sorting->GetPageOrdinal(extension_misc::kWebStoreAppId).IsValid());
+ EXPECT_TRUE(
+ sorting->GetAppLaunchOrdinal(extension_misc::kWebStoreAppId).IsValid());
+}
+
TEST_F(ExtensionServiceTest, InstallAppsWithUnlimitedStorage) {
InitializeEmptyExtensionService();
InitializeRequestContext();