| 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/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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Copy a node to the clipboard. | 135 // Copy a node to the clipboard. |
| 136 std::vector<const BookmarkNode*> nodes; | 136 std::vector<const BookmarkNode*> nodes; |
| 137 nodes.push_back(node); | 137 nodes.push_back(node); |
| 138 CopyToClipboard(&model, nodes, false); | 138 CopyToClipboard(&model, nodes, false); |
| 139 | 139 |
| 140 // And make sure we can paste a bookmark from the clipboard. | 140 // And make sure we can paste a bookmark from the clipboard. |
| 141 EXPECT_TRUE(CanPasteFromClipboard(model.bookmark_bar_node())); | 141 EXPECT_TRUE(CanPasteFromClipboard(model.bookmark_bar_node())); |
| 142 | 142 |
| 143 // Write some text to the clipboard. | 143 // Write some text to the clipboard. |
| 144 { | 144 { |
| 145 ui::ScopedClipboardWriter clipboard_writer(g_browser_process->clipboard(), | 145 ui::ScopedClipboardWriter clipboard_writer( |
| 146 ui::Clipboard::BUFFER_STANDARD); | 146 ui::Clipboard::GetForCurrentThread(), |
| 147 ui::Clipboard::BUFFER_STANDARD); |
| 147 clipboard_writer.WriteText(ASCIIToUTF16("foo")); | 148 clipboard_writer.WriteText(ASCIIToUTF16("foo")); |
| 148 } | 149 } |
| 149 | 150 |
| 150 // Now we shouldn't be able to paste from the clipboard. | 151 // Now we shouldn't be able to paste from the clipboard. |
| 151 EXPECT_FALSE(CanPasteFromClipboard(model.bookmark_bar_node())); | 152 EXPECT_FALSE(CanPasteFromClipboard(model.bookmark_bar_node())); |
| 152 } | 153 } |
| 153 #endif | 154 #endif |
| 154 | 155 |
| 155 } // namespace | 156 } // namespace |
| 156 } // namespace bookmark_utils | 157 } // namespace bookmark_utils |
| OLD | NEW |