Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: components/undo/undo_manager_test.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/undo/undo_manager.h" 5 #include "components/undo/undo_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/undo/undo_manager_observer.h" 10 #include "components/undo/undo_manager_observer.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 TestUndoService::~TestUndoService() { 82 TestUndoService::~TestUndoService() {
83 } 83 }
84 84
85 void TestUndoService::Redo() { 85 void TestUndoService::Redo() {
86 base::AutoReset<bool> incoming_changes(&performing_redo_, true); 86 base::AutoReset<bool> incoming_changes(&performing_redo_, true);
87 undo_manager_.Redo(); 87 undo_manager_.Redo();
88 } 88 }
89 89
90 void TestUndoService::TriggerOperation() { 90 void TestUndoService::TriggerOperation() {
91 undo_manager_.AddUndoOperation(base::WrapUnique(new TestUndoOperation(this))); 91 undo_manager_.AddUndoOperation(base::MakeUnique<TestUndoOperation>(this));
92 } 92 }
93 93
94 void TestUndoService::RecordUndoCall() { 94 void TestUndoService::RecordUndoCall() {
95 if (performing_redo_) 95 if (performing_redo_)
96 ++redo_operation_count_; 96 ++redo_operation_count_;
97 else 97 else
98 ++undo_operation_count_; 98 ++undo_operation_count_;
99 } 99 }
100 100
101 // TestObserver ---------------------------------------------------------------- 101 // TestObserver ----------------------------------------------------------------
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 undo_service.undo_manager_.Redo(); 259 undo_service.undo_manager_.Redo();
260 int callback_count_after_redo = observer.state_change_count(); 260 int callback_count_after_redo = observer.state_change_count();
261 EXPECT_GT(callback_count_after_redo, callback_count_after_undo); 261 EXPECT_GT(callback_count_after_redo, callback_count_after_undo);
262 262
263 undo_service.undo_manager_.RemoveObserver(&observer); 263 undo_service.undo_manager_.RemoveObserver(&observer);
264 undo_service.undo_manager_.Undo(); 264 undo_service.undo_manager_.Undo();
265 EXPECT_EQ(callback_count_after_redo, observer.state_change_count()); 265 EXPECT_EQ(callback_count_after_redo, observer.state_change_count());
266 } 266 }
267 267
268 } // namespace 268 } // namespace
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_ui_delegate_unittest.cc ('k') | components/url_matcher/url_matcher_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698