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

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

Issue 8735019: Add App Notification Sync Integration Test (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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/single_client_app_notification_sync_test.cc
===================================================================
--- chrome/browser/sync/test/integration/single_client_app_notification_sync_test.cc (revision 0)
+++ chrome/browser/sync/test/integration/single_client_app_notification_sync_test.cc (revision 0)
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/app_notification_manager.h"
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sync/profile_sync_service_harness.h"
+#include "chrome/browser/sync/test/integration/app_notification_helper.h"
+#include "chrome/browser/sync/test/integration/sync_test.h"
+#include "content/test/test_browser_thread.h"
+
+using app_notification_helper::GetServiceForProfile;
+using app_notification_helper::GetVerifierService;
+using app_notification_helper::ServiceMatchesVerifier;
+using app_notification_helper::AddNotification;
+using content::BrowserThread;
+
+class SingleClientAppNotificationSyncTest : public SyncTest {
+ public:
+ SingleClientAppNotificationSyncTest() : SyncTest(SINGLE_CLIENT) {}
+ virtual ~SingleClientAppNotificationSyncTest() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SingleClientAppNotificationSyncTest);
+};
+
+static void PostQuitToUIThread() {
+ BrowserThread::PostTask(BrowserThread::UI,
+ FROM_HERE,
+ new MessageLoop::QuitTask());
+}
+
+IN_PROC_BROWSER_TEST_F(SingleClientAppNotificationSyncTest, Sanity) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
lipalani1 2011/12/03 01:25:40 Should this be done before setup sync?
+ verifier()->InitExtensions(true);
+ BrowserThread::PostTask(BrowserThread::FILE,
+ FROM_HERE,
Raghu Simha 2011/12/05 18:33:56 nit: Fix indentation.
+ base::Bind(&PostQuitToUIThread));
+ MessageLoop::current()->Run();
+ ASSERT_TRUE(ServiceMatchesVerifier(0, "extensionId"));
+ AddNotification(0, 1);
+ ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion(
lipalani1 2011/12/03 01:25:40 Change this from search engine.
+ "Waiting for search engines to update."));
+ ASSERT_TRUE(ServiceMatchesVerifier(0, "extensionId"));
+}
+
+
+

Powered by Google App Engine
This is Rietveld 408576698