OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 string())); | 115 string())); |
116 EXPECT_TRUE(DoesBookmarkContainText( | 116 EXPECT_TRUE(DoesBookmarkContainText( |
117 node, WideToUTF16(L"Fr\u00C4n\u00C7\u00F3S\u00EA"), string())); | 117 node, WideToUTF16(L"Fr\u00C4n\u00C7\u00F3S\u00EA"), string())); |
118 EXPECT_TRUE(DoesBookmarkContainText( | 118 EXPECT_TRUE(DoesBookmarkContainText( |
119 node, WideToUTF16(L"fr\u00C4n\u00C7\u00D3s\u00CA"), string())); | 119 node, WideToUTF16(L"fr\u00C4n\u00C7\u00D3s\u00CA"), string())); |
120 EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("fba"), string())); | 120 EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("fba"), string())); |
121 EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("FBA"), string())); | 121 EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("FBA"), string())); |
122 } | 122 } |
123 | 123 |
124 #if !defined(OS_MACOSX) | 124 #if !defined(OS_MACOSX) |
125 #if defined(TOUCH_UI) | 125 TEST(BookmarkUtilsTest, CopyPaste) { |
126 // TODO(wyck): Functionality disabled on TOUCH_UI to work around clipboard hang | |
127 // in http://crbug.com/96448 | |
128 #define MAYBE_CopyPaste FAILS_CopyPaste | |
129 #else | |
130 #define MAYBE_CopyPaste CopyPaste | |
131 #endif | |
132 TEST(BookmarkUtilsTest, MAYBE_CopyPaste) { | |
133 // Clipboard requires a message loop. | 126 // Clipboard requires a message loop. |
134 MessageLoopForUI loop; | 127 MessageLoopForUI loop; |
135 | 128 |
136 BookmarkModel model(NULL); | 129 BookmarkModel model(NULL); |
137 const BookmarkNode* node = model.AddURL(model.other_node(), | 130 const BookmarkNode* node = model.AddURL(model.other_node(), |
138 0, | 131 0, |
139 ASCIIToUTF16("foo bar"), | 132 ASCIIToUTF16("foo bar"), |
140 GURL("http://www.google.com")); | 133 GURL("http://www.google.com")); |
141 | 134 |
142 // Copy a node to the clipboard. | 135 // Copy a node to the clipboard. |
(...skipping 10 matching lines...) Expand all Loading... |
153 clipboard_writer.WriteText(ASCIIToUTF16("foo")); | 146 clipboard_writer.WriteText(ASCIIToUTF16("foo")); |
154 } | 147 } |
155 | 148 |
156 // Now we shouldn't be able to paste from the clipboard. | 149 // Now we shouldn't be able to paste from the clipboard. |
157 EXPECT_FALSE(CanPasteFromClipboard(model.bookmark_bar_node())); | 150 EXPECT_FALSE(CanPasteFromClipboard(model.bookmark_bar_node())); |
158 } | 151 } |
159 #endif | 152 #endif |
160 | 153 |
161 } // namespace | 154 } // namespace |
162 } // namespace bookmark_utils | 155 } // namespace bookmark_utils |
OLD | NEW |