OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/sync/notifier/non_blocking_invalidation_notifier.h" | 5 #include "chrome/browser/sync/notifier/non_blocking_invalidation_notifier.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/sync/notifier/invalidation_version_tracker.h" | 10 #include "chrome/browser/sync/notifier/invalidation_version_tracker.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 base::Thread::Options options; | 36 base::Thread::Options options; |
37 options.message_loop_type = MessageLoop::TYPE_IO; | 37 options.message_loop_type = MessageLoop::TYPE_IO; |
38 io_thread_.StartIOThread(); | 38 io_thread_.StartIOThread(); |
39 request_context_getter_ = new TestURLRequestContextGetter; | 39 request_context_getter_ = new TestURLRequestContextGetter; |
40 notifier::NotifierOptions notifier_options; | 40 notifier::NotifierOptions notifier_options; |
41 notifier_options.request_context_getter = request_context_getter_; | 41 notifier_options.request_context_getter = request_context_getter_; |
42 invalidation_notifier_.reset( | 42 invalidation_notifier_.reset( |
43 new NonBlockingInvalidationNotifier( | 43 new NonBlockingInvalidationNotifier( |
44 notifier_options, | 44 notifier_options, |
45 InvalidationVersionMap(), | 45 InvalidationVersionMap(), |
46 browser_sync::WeakHandle<InvalidationVersionTracker>( | 46 browser_sync::MakeWeakHandle( |
47 base::WeakPtr<sync_notifier::InvalidationVersionTracker>()), | 47 base::WeakPtr<sync_notifier::InvalidationVersionTracker>()), |
48 "fake_client_info")); | 48 "fake_client_info")); |
49 invalidation_notifier_->AddObserver(&mock_observer_); | 49 invalidation_notifier_->AddObserver(&mock_observer_); |
50 } | 50 } |
51 | 51 |
52 virtual void TearDown() { | 52 virtual void TearDown() { |
53 invalidation_notifier_->RemoveObserver(&mock_observer_); | 53 invalidation_notifier_->RemoveObserver(&mock_observer_); |
54 invalidation_notifier_.reset(); | 54 invalidation_notifier_.reset(); |
55 request_context_getter_ = NULL; | 55 request_context_getter_ = NULL; |
56 io_thread_.Stop(); | 56 io_thread_.Stop(); |
(...skipping 18 matching lines...) Expand all Loading... |
75 invalidation_notifier_->UpdateCredentials("foo@bar.com", "fake_token"); | 75 invalidation_notifier_->UpdateCredentials("foo@bar.com", "fake_token"); |
76 invalidation_notifier_->UpdateEnabledTypes(types); | 76 invalidation_notifier_->UpdateEnabledTypes(types); |
77 } | 77 } |
78 | 78 |
79 // TODO(akalin): Add synchronous operations for testing to | 79 // TODO(akalin): Add synchronous operations for testing to |
80 // NonBlockingInvalidationNotifierTest and use that to test it. | 80 // NonBlockingInvalidationNotifierTest and use that to test it. |
81 | 81 |
82 } // namespace | 82 } // namespace |
83 | 83 |
84 } // namespace sync_notifier | 84 } // namespace sync_notifier |
OLD | NEW |