| Index: ui/views/view_unittest.cc
|
| diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
|
| index c902b17685453c0a739e70096db284f0154629e8..846620b201f6b42b522d369b10c4dd86880f68f0 100644
|
| --- a/ui/views/view_unittest.cc
|
| +++ b/ui/views/view_unittest.cc
|
| @@ -1168,8 +1168,6 @@ TEST_F(ViewTest, Textfield) {
|
| const string16 kExtraText = ASCIIToUTF16("Pretty deep, Philip!");
|
| const string16 kEmptyString;
|
|
|
| - ui::Clipboard clipboard;
|
| -
|
| Widget* widget = new Widget;
|
| Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
|
| params.bounds = gfx::Rect(0, 0, 100, 100);
|
| @@ -1206,7 +1204,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
|
| const string16 kReadOnlyText = ASCIIToUTF16("Read only");
|
| const string16 kPasswordText = ASCIIToUTF16("Password! ** Secret stuff **");
|
|
|
| - ui::Clipboard clipboard;
|
| + ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
|
|
|
| Widget* widget = new Widget;
|
| Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
|
| @@ -1235,7 +1233,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
|
| ::SendMessage(normal->GetTestingHandle(), WM_CUT, 0, 0);
|
|
|
| string16 result;
|
| - clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| + clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| EXPECT_EQ(kNormalText, result);
|
| normal->SetText(kNormalText); // Let's revert to the original content.
|
|
|
| @@ -1243,7 +1241,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
|
| read_only->SelectAll(false);
|
| ::SendMessage(read_only->GetTestingHandle(), WM_CUT, 0, 0);
|
| result.clear();
|
| - clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| + clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| // Cut should have failed, so the clipboard content should not have changed.
|
| EXPECT_EQ(kNormalText, result);
|
|
|
| @@ -1251,7 +1249,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
|
| password->SelectAll(false);
|
| ::SendMessage(password->GetTestingHandle(), WM_CUT, 0, 0);
|
| result.clear();
|
| - clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| + clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| // Cut should have failed, so the clipboard content should not have changed.
|
| EXPECT_EQ(kNormalText, result);
|
|
|
| @@ -1264,19 +1262,19 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
|
| read_only->SelectAll(false);
|
| ::SendMessage(read_only->GetTestingHandle(), WM_COPY, 0, 0);
|
| result.clear();
|
| - clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| + clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| EXPECT_EQ(kReadOnlyText, result);
|
|
|
| normal->SelectAll(false);
|
| ::SendMessage(normal->GetTestingHandle(), WM_COPY, 0, 0);
|
| result.clear();
|
| - clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| + clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| EXPECT_EQ(kNormalText, result);
|
|
|
| password->SelectAll(false);
|
| ::SendMessage(password->GetTestingHandle(), WM_COPY, 0, 0);
|
| result.clear();
|
| - clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| + clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
|
| // We don't let you copy from an obscured field, clipboard should not have
|
| // changed.
|
| EXPECT_EQ(kNormalText, result);
|
|
|