| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/macros.h" |
| 6 #include "components/undo/undo_manager.h" | 7 #include "components/undo/undo_manager.h" |
| 7 #include "components/undo/undo_manager_observer.h" | 8 #include "components/undo/undo_manager_observer.h" |
| 8 #include "components/undo/undo_operation.h" | 9 #include "components/undo/undo_operation.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 class TestUndoOperation; | 14 class TestUndoOperation; |
| 14 | 15 |
| 15 // TestUndoService ------------------------------------------------------------- | 16 // TestUndoService ------------------------------------------------------------- |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 undo_service.undo_manager_.Redo(); | 257 undo_service.undo_manager_.Redo(); |
| 257 int callback_count_after_redo = observer.state_change_count(); | 258 int callback_count_after_redo = observer.state_change_count(); |
| 258 EXPECT_GT(callback_count_after_redo, callback_count_after_undo); | 259 EXPECT_GT(callback_count_after_redo, callback_count_after_undo); |
| 259 | 260 |
| 260 undo_service.undo_manager_.RemoveObserver(&observer); | 261 undo_service.undo_manager_.RemoveObserver(&observer); |
| 261 undo_service.undo_manager_.Undo(); | 262 undo_service.undo_manager_.Undo(); |
| 262 EXPECT_EQ(callback_count_after_redo, observer.state_change_count()); | 263 EXPECT_EQ(callback_count_after_redo, observer.state_change_count()); |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace | 266 } // namespace |
| OLD | NEW |