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

Unified Diff: views/controls/textfield/textfield_views_model_unittest.cc

Issue 6132009: Delete test view delegate at end of test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/views/controls/textfield
Patch Set: nicer code Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/textfield_views_model_unittest.cc
diff --git a/views/controls/textfield/textfield_views_model_unittest.cc b/views/controls/textfield/textfield_views_model_unittest.cc
index 388c8c3953fb7e8bd6448f72036c251013c2af26..eff16eeff0feb3b3febb69beccc8249290d93c2b 100644
--- a/views/controls/textfield/textfield_views_model_unittest.cc
+++ b/views/controls/textfield/textfield_views_model_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/auto_reset.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/utf_string_conversions.h"
@@ -289,7 +290,9 @@ TEST(TextfieldViewsModelTest, SetText) {
}
TEST(TextfieldViewsModelTest, Clipboard) {
- views::ViewsDelegate::views_delegate = new TestViewsDelegate();
+ scoped_ptr<TestViewsDelegate> test_views_delegate(new TestViewsDelegate());
+ AutoReset<views::ViewsDelegate*> auto_reset(
+ &views::ViewsDelegate::views_delegate, test_views_delegate.get());
ui::Clipboard* clipboard
= views::ViewsDelegate::views_delegate->GetClipboard();
string16 initial_clipboard_text;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698