OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/omnibox/omnibox_view.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ui::Clipboard::BUFFER_STANDARD); | 56 ui::Clipboard::BUFFER_STANDARD); |
57 clipboard_writer.WriteText(kPlainText); | 57 clipboard_writer.WriteText(kPlainText); |
58 } | 58 } |
59 EXPECT_EQ(kPlainText, OmniboxView::GetClipboardText()); | 59 EXPECT_EQ(kPlainText, OmniboxView::GetClipboardText()); |
60 | 60 |
61 // TODO(shess): Aura hits a DCHECK() at CommitToClipboard() if | 61 // TODO(shess): Aura hits a DCHECK() at CommitToClipboard() if |
62 // ObjectMap is empty. http://crbug.com/133848 | 62 // ObjectMap is empty. http://crbug.com/133848 |
63 #if !defined(USE_AURA) | 63 #if !defined(USE_AURA) |
64 // Does an empty clipboard get empty text? | 64 // Does an empty clipboard get empty text? |
65 clipboard->WriteObjects(ui::Clipboard::BUFFER_STANDARD, | 65 clipboard->WriteObjects(ui::Clipboard::BUFFER_STANDARD, |
66 ui::Clipboard::ObjectMap()); | 66 ui::Clipboard::ObjectMap(), |
| 67 ui::Clipboard::SourceTag()); |
67 EXPECT_EQ(string16(), OmniboxView::GetClipboardText()); | 68 EXPECT_EQ(string16(), OmniboxView::GetClipboardText()); |
68 #endif | 69 #endif |
69 | 70 |
70 // Bookmark clipboard apparently not supported on Linux. | 71 // Bookmark clipboard apparently not supported on Linux. |
71 // See TODO on ClipboardText.BookmarkTest. | 72 // See TODO on ClipboardText.BookmarkTest. |
72 #if !defined(OS_POSIX) || defined(OS_MACOSX) | 73 #if !defined(OS_POSIX) || defined(OS_MACOSX) |
73 const string16 kTitle(ASCIIToUTF16("The Example Company")); | 74 const string16 kTitle(ASCIIToUTF16("The Example Company")); |
74 // Can we pull a bookmark off the clipboard? | 75 // Can we pull a bookmark off the clipboard? |
75 { | 76 { |
76 ui::ScopedClipboardWriter clipboard_writer(clipboard, | 77 ui::ScopedClipboardWriter clipboard_writer(clipboard, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 ui::Clipboard::BUFFER_STANDARD); | 122 ui::Clipboard::BUFFER_STANDARD); |
122 clipboard_writer.WriteText(kWrappedAddress); | 123 clipboard_writer.WriteText(kWrappedAddress); |
123 } | 124 } |
124 | 125 |
125 const string16 kFixedAddress(ASCIIToUTF16( | 126 const string16 kFixedAddress(ASCIIToUTF16( |
126 "1600 Amphitheatre Parkway Mountain View, CA")); | 127 "1600 Amphitheatre Parkway Mountain View, CA")); |
127 EXPECT_EQ(kFixedAddress, OmniboxView::GetClipboardText()); | 128 EXPECT_EQ(kFixedAddress, OmniboxView::GetClipboardText()); |
128 } | 129 } |
129 | 130 |
130 } // namespace | 131 } // namespace |
OLD | NEW |