| 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 "chrome/browser/undo/undo_manager.h" | 6 #include "components/undo/undo_manager.h" |
| 7 #include "chrome/browser/undo/undo_manager_observer.h" | 7 #include "components/undo/undo_manager_observer.h" |
| 8 #include "chrome/browser/undo/undo_operation.h" | 8 #include "components/undo/undo_operation.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 class TestUndoOperation; | 13 class TestUndoOperation; |
| 14 | 14 |
| 15 // TestUndoService ------------------------------------------------------------- | 15 // TestUndoService ------------------------------------------------------------- |
| 16 | 16 |
| 17 class TestUndoService { | 17 class TestUndoService { |
| 18 public: | 18 public: |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 undo_service.undo_manager_.Redo(); | 256 undo_service.undo_manager_.Redo(); |
| 257 int callback_count_after_redo = observer.state_change_count(); | 257 int callback_count_after_redo = observer.state_change_count(); |
| 258 EXPECT_GT(callback_count_after_redo, callback_count_after_undo); | 258 EXPECT_GT(callback_count_after_redo, callback_count_after_undo); |
| 259 | 259 |
| 260 undo_service.undo_manager_.RemoveObserver(&observer); | 260 undo_service.undo_manager_.RemoveObserver(&observer); |
| 261 undo_service.undo_manager_.Undo(); | 261 undo_service.undo_manager_.Undo(); |
| 262 EXPECT_EQ(callback_count_after_redo, observer.state_change_count()); | 262 EXPECT_EQ(callback_count_after_redo, observer.state_change_count()); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace | 265 } // namespace |
| OLD | NEW |