| 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/js/js_sync_manager_observer.h" | 5 #include "chrome/browser/sync/js/js_sync_manager_observer.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/sync/syncable/model_type.h" | 21 #include "chrome/browser/sync/syncable/model_type.h" |
| 22 #include "chrome/browser/sync/weak_handle.h" | 22 #include "chrome/browser/sync/weak_handle.h" |
| 23 #include "chrome/test/sync/engine/test_user_share.h" | 23 #include "chrome/test/sync/engine/test_user_share.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 | 25 |
| 26 namespace browser_sync { | 26 namespace browser_sync { |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 using ::testing::InSequence; | 29 using ::testing::InSequence; |
| 30 using ::testing::StrictMock; | 30 using ::testing::StrictMock; |
| 31 using browser_sync::sessions::SyncProtocolError; |
| 31 | 32 |
| 32 class JsSyncManagerObserverTest : public testing::Test { | 33 class JsSyncManagerObserverTest : public testing::Test { |
| 33 protected: | 34 protected: |
| 34 JsSyncManagerObserverTest() { | 35 JsSyncManagerObserverTest() { |
| 35 js_sync_manager_observer_.SetJsEventHandler( | 36 js_sync_manager_observer_.SetJsEventHandler( |
| 36 mock_js_event_handler_.AsWeakHandle()); | 37 mock_js_event_handler_.AsWeakHandle()); |
| 37 } | 38 } |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 // This must be destroyed after the member variables below in order | 41 // This must be destroyed after the member variables below in order |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 syncable::ModelTypeBitSet(), | 104 syncable::ModelTypeBitSet(), |
| 104 download_progress_markers, | 105 download_progress_markers, |
| 105 false, | 106 false, |
| 106 true, | 107 true, |
| 107 100, | 108 100, |
| 108 8, | 109 8, |
| 109 5, | 110 5, |
| 110 false, | 111 false, |
| 111 sessions::SyncSourceInfo(), | 112 sessions::SyncSourceInfo(), |
| 112 0, | 113 0, |
| 113 base::Time::Now()); | 114 base::Time::Now(), |
| 115 sessions::SyncProtocolError()); |
| 114 DictionaryValue expected_details; | 116 DictionaryValue expected_details; |
| 115 expected_details.Set("snapshot", snapshot.ToValue()); | 117 expected_details.Set("snapshot", snapshot.ToValue()); |
| 116 | 118 |
| 117 EXPECT_CALL(mock_js_event_handler_, | 119 EXPECT_CALL(mock_js_event_handler_, |
| 118 HandleJsEvent("onSyncCycleCompleted", | 120 HandleJsEvent("onSyncCycleCompleted", |
| 119 HasDetailsAsDictionary(expected_details))); | 121 HasDetailsAsDictionary(expected_details))); |
| 120 | 122 |
| 121 js_sync_manager_observer_.OnSyncCycleCompleted(&snapshot); | 123 js_sync_manager_observer_.OnSyncCycleCompleted(&snapshot); |
| 122 PumpLoop(); | 124 PumpLoop(); |
| 123 } | 125 } |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 &trans, &changes[i], | 331 &trans, &changes[i], |
| 330 syncable::MODEL_TYPE_COUNT - i); | 332 syncable::MODEL_TYPE_COUNT - i); |
| 331 } | 333 } |
| 332 | 334 |
| 333 test_user_share.TearDown(); | 335 test_user_share.TearDown(); |
| 334 PumpLoop(); | 336 PumpLoop(); |
| 335 } | 337 } |
| 336 | 338 |
| 337 } // namespace | 339 } // namespace |
| 338 } // namespace browser_sync | 340 } // namespace browser_sync |
| OLD | NEW |