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

Side by Side Diff: chrome/browser/invalidation/ticl_invalidation_service_unittest.cc

Issue 179843002: Make invalidations work for Chrome OS Kiosk Apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/invalidation/ticl_invalidation_service.h" 5 #include "chrome/browser/invalidation/ticl_invalidation_service.h"
6 6
7 #include "chrome/browser/invalidation/invalidation_service_factory.h" 7 #include "chrome/browser/invalidation/invalidation_service_factory.h"
8 #include "chrome/browser/invalidation/invalidation_service_test_template.h" 8 #include "chrome/browser/invalidation/invalidation_service_test_template.h"
9 #include "chrome/browser/invalidation/profile_invalidation_auth_provider.h"
9 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 10 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
10 #include "chrome/test/base/testing_profile.h" 11 #include "chrome/test/base/testing_profile.h"
11 #include "sync/notifier/fake_invalidation_handler.h" 12 #include "sync/notifier/fake_invalidation_handler.h"
12 #include "sync/notifier/fake_invalidator.h" 13 #include "sync/notifier/fake_invalidator.h"
13 #include "sync/notifier/invalidation_util.h" 14 #include "sync/notifier/invalidation_util.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 namespace invalidation { 17 namespace invalidation {
17 18
18 class TiclInvalidationServiceTestDelegate { 19 class TiclInvalidationServiceTestDelegate {
19 public: 20 public:
20 TiclInvalidationServiceTestDelegate() { } 21 TiclInvalidationServiceTestDelegate() { }
21 22
22 ~TiclInvalidationServiceTestDelegate() { 23 ~TiclInvalidationServiceTestDelegate() {
23 DestroyInvalidationService(); 24 DestroyInvalidationService();
24 } 25 }
25 26
26 void CreateInvalidationService() { 27 void CreateInvalidationService() {
27 fake_invalidator_ = new syncer::FakeInvalidator(); 28 fake_invalidator_ = new syncer::FakeInvalidator();
28 profile_.reset(new TestingProfile()); 29 profile_.reset(new TestingProfile());
29 token_service_.reset(new FakeProfileOAuth2TokenService); 30 token_service_.reset(new FakeProfileOAuth2TokenService);
30 invalidation_service_.reset( 31 invalidation_service_.reset(new TiclInvalidationService(
31 new TiclInvalidationService(NULL, 32 scoped_ptr<InvalidationAuthProvider>(
32 token_service_.get(), 33 new ProfileInvalidationAuthProvider(
33 profile_.get())); 34 NULL, token_service_.get(), NULL, profile_.get())),
pavely 2014/03/07 23:43:29 This shouldn't compile, ProfileInvalidationAuthPro
Mattias Nissler (ping if slow) 2014/03/08 01:30:07 Yes, I've fixed this meanwhile - failed to compile
35 profile_.get()));
34 invalidation_service_->InitForTest(fake_invalidator_); 36 invalidation_service_->InitForTest(fake_invalidator_);
35 } 37 }
36 38
37 InvalidationService* GetInvalidationService() { 39 InvalidationService* GetInvalidationService() {
38 return invalidation_service_.get(); 40 return invalidation_service_.get();
39 } 41 }
40 42
41 void DestroyInvalidationService() { 43 void DestroyInvalidationService() {
42 invalidation_service_->Shutdown(); 44 invalidation_service_->Shutdown();
43 } 45 }
(...skipping 11 matching lines...) Expand all
55 scoped_ptr<TiclInvalidationService> invalidation_service_; 57 scoped_ptr<TiclInvalidationService> invalidation_service_;
56 scoped_ptr<TestingProfile> profile_; 58 scoped_ptr<TestingProfile> profile_;
57 scoped_ptr<FakeProfileOAuth2TokenService> token_service_; 59 scoped_ptr<FakeProfileOAuth2TokenService> token_service_;
58 }; 60 };
59 61
60 INSTANTIATE_TYPED_TEST_CASE_P( 62 INSTANTIATE_TYPED_TEST_CASE_P(
61 TiclInvalidationServiceTest, InvalidationServiceTest, 63 TiclInvalidationServiceTest, InvalidationServiceTest,
62 TiclInvalidationServiceTestDelegate); 64 TiclInvalidationServiceTestDelegate);
63 65
64 } // namespace invalidation 66 } // namespace invalidation
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698