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

Side by Side Diff: ui/views/controls/textfield/textfield_unittest.cc

Issue 558913003: Remove clipboard argument from ScopedClipboardWriter constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't leak a clipboard on Windows Created 6 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
« no previous file with comments | « ui/views/controls/textfield/textfield_model_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/controls/textfield/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 scoped_ptr<views::Textfield> target_; 140 scoped_ptr<views::Textfield> target_;
141 }; 141 };
142 142
143 base::string16 GetClipboardText(ui::ClipboardType type) { 143 base::string16 GetClipboardText(ui::ClipboardType type) {
144 base::string16 text; 144 base::string16 text;
145 ui::Clipboard::GetForCurrentThread()->ReadText(type, &text); 145 ui::Clipboard::GetForCurrentThread()->ReadText(type, &text);
146 return text; 146 return text;
147 } 147 }
148 148
149 void SetClipboardText(ui::ClipboardType type, const std::string& text) { 149 void SetClipboardText(ui::ClipboardType type, const std::string& text) {
150 ui::ScopedClipboardWriter(ui::Clipboard::GetForCurrentThread(), type) 150 ui::ScopedClipboardWriter(type).WriteText(ASCIIToUTF16(text));
151 .WriteText(ASCIIToUTF16(text));
152 } 151 }
153 152
154 } // namespace 153 } // namespace
155 154
156 namespace views { 155 namespace views {
157 156
158 class TextfieldTest : public ViewsTestBase, public TextfieldController { 157 class TextfieldTest : public ViewsTestBase, public TextfieldController {
159 public: 158 public:
160 TextfieldTest() 159 TextfieldTest()
161 : widget_(NULL), 160 : widget_(NULL),
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 TextfieldDestroyerController controller(textfield_); 2062 TextfieldDestroyerController controller(textfield_);
2064 EXPECT_TRUE(controller.target()); 2063 EXPECT_TRUE(controller.target());
2065 2064
2066 // Send a key to trigger OnKeyEvent(). 2065 // Send a key to trigger OnKeyEvent().
2067 SendKeyEvent('X'); 2066 SendKeyEvent('X');
2068 2067
2069 EXPECT_FALSE(controller.target()); 2068 EXPECT_FALSE(controller.target());
2070 } 2069 }
2071 2070
2072 } // namespace views 2071 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698