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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/app_notification_manager.h"
6 #include "chrome/browser/extensions/extension_service.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sync/profile_sync_service_harness.h"
9 #include "chrome/browser/sync/test/integration/app_notification_helper.h"
10 #include "chrome/browser/sync/test/integration/sync_test.h"
11 #include "content/test/test_browser_thread.h"
12
13 using app_notification_helper::GetServiceForProfile;
14 using app_notification_helper::GetVerifierService;
15 using app_notification_helper::ServiceMatchesVerifier;
16 using app_notification_helper::AddNotification;
17 using content::BrowserThread;
18
19 class SingleClientAppNotificationSyncTest : public SyncTest {
20 public:
21 SingleClientAppNotificationSyncTest() : SyncTest(SINGLE_CLIENT) {}
22 virtual ~SingleClientAppNotificationSyncTest() {}
23
24 private:
25 DISALLOW_COPY_AND_ASSIGN(SingleClientAppNotificationSyncTest);
26 };
27
28 static void PostQuitToUIThread() {
29 BrowserThread::PostTask(BrowserThread::UI,
30 FROM_HERE,
31 new MessageLoop::QuitTask());
32 }
33
34 IN_PROC_BROWSER_TEST_F(SingleClientAppNotificationSyncTest, Sanity) {
35 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
36
lipalani1 2011/12/03 01:25:40 Should this be done before setup sync?
37 verifier()->InitExtensions(true);
38 BrowserThread::PostTask(BrowserThread::FILE,
39 FROM_HERE,
Raghu Simha 2011/12/05 18:33:56 nit: Fix indentation.
40 base::Bind(&PostQuitToUIThread));
41 MessageLoop::current()->Run();
42 ASSERT_TRUE(ServiceMatchesVerifier(0, "extensionId"));
43 AddNotification(0, 1);
44 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion(
lipalani1 2011/12/03 01:25:40 Change this from search engine.
45 "Waiting for search engines to update."));
46 ASSERT_TRUE(ServiceMatchesVerifier(0, "extensionId"));
47 }
48
49
50
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698