OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); | 277 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); |
278 bookmark_dtc_->Stop(); | 278 bookmark_dtc_->Stop(); |
279 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); | 279 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); |
280 } | 280 } |
281 | 281 |
282 TEST_F(SyncBookmarkDataTypeControllerTest, OnSingleDatatypeUnrecoverableError) { | 282 TEST_F(SyncBookmarkDataTypeControllerTest, OnSingleDatatypeUnrecoverableError) { |
283 SetStartExpectations(); | 283 SetStartExpectations(); |
284 SetAssociateExpectations(); | 284 SetAssociateExpectations(); |
285 EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). | 285 EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). |
286 WillRepeatedly(DoAll(SetArgumentPointee<0>(true), Return(true))); | 286 WillRepeatedly(DoAll(SetArgumentPointee<0>(true), Return(true))); |
287 EXPECT_CALL(service_, OnDisableDatatype(_,_,_)). | 287 EXPECT_CALL(service_, DisableBrokenDatatype(_,_,_)). |
288 WillOnce(InvokeWithoutArgs(bookmark_dtc_.get(), | 288 WillOnce(InvokeWithoutArgs(bookmark_dtc_.get(), |
289 &BookmarkDataTypeController::Stop)); | 289 &BookmarkDataTypeController::Stop)); |
290 SetStopExpectations(); | 290 SetStopExpectations(); |
291 | 291 |
292 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _)); | 292 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _)); |
293 Start(); | 293 Start(); |
294 // This should cause bookmark_dtc_->Stop() to be called. | 294 // This should cause bookmark_dtc_->Stop() to be called. |
295 bookmark_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test"); | 295 bookmark_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test"); |
296 PumpLoop(); | 296 PumpLoop(); |
297 } | 297 } |
OLD | NEW |