OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.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 "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
11 #include "chrome/browser/bookmarks/bookmark_utils.h" | 11 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 12 #include "chrome/test/testing_browser_process_test.h" |
12 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 13 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
13 | 14 |
14 #if !defined(OS_MACOSX) | 15 #if !defined(OS_MACOSX) |
15 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
16 #endif | 17 #endif |
17 | 18 |
18 typedef testing::Test BookmarkUtilsTest; | 19 typedef TestingBrowserProcessTest BookmarkUtilsTest; |
19 | 20 |
20 TEST_F(BookmarkUtilsTest, GetBookmarksContainingText) { | 21 TEST_F(BookmarkUtilsTest, GetBookmarksContainingText) { |
21 BookmarkModel model(NULL); | 22 BookmarkModel model(NULL); |
22 const BookmarkNode* n1 = | 23 const BookmarkNode* n1 = |
23 model.AddURL(model.other_node(), 0, ASCIIToUTF16("foo bar"), | 24 model.AddURL(model.other_node(), 0, ASCIIToUTF16("foo bar"), |
24 GURL("http://www.google.com")); | 25 GURL("http://www.google.com")); |
25 const BookmarkNode* n2 = | 26 const BookmarkNode* n2 = |
26 model.AddURL(model.other_node(), 0, ASCIIToUTF16("baz buz"), | 27 model.AddURL(model.other_node(), 0, ASCIIToUTF16("baz buz"), |
27 GURL("http://www.cnn.com")); | 28 GURL("http://www.cnn.com")); |
28 | 29 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 { | 124 { |
124 ui::ScopedClipboardWriter clipboard_writer(g_browser_process->clipboard()); | 125 ui::ScopedClipboardWriter clipboard_writer(g_browser_process->clipboard()); |
125 clipboard_writer.WriteText(ASCIIToUTF16("foo")); | 126 clipboard_writer.WriteText(ASCIIToUTF16("foo")); |
126 } | 127 } |
127 | 128 |
128 // Now we shouldn't be able to paste from the clipboard. | 129 // Now we shouldn't be able to paste from the clipboard. |
129 EXPECT_FALSE( | 130 EXPECT_FALSE( |
130 bookmark_utils::CanPasteFromClipboard(model.GetBookmarkBarNode())); | 131 bookmark_utils::CanPasteFromClipboard(model.GetBookmarkBarNode())); |
131 } | 132 } |
132 #endif | 133 #endif |
OLD | NEW |