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_editor.h" | 9 #include "chrome/browser/bookmarks/bookmark_editor.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/base/clipboard/clipboard.h" | 12 #include "ui/base/clipboard/clipboard.h" |
13 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 13 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
14 | 14 |
15 using std::string; | 15 using std::string; |
16 | 16 |
17 namespace bookmark_utils { | 17 namespace bookmark_utils { |
18 namespace { | 18 namespace { |
19 | 19 |
20 class BookmarkUtilsTest : public ::testing::Test { | 20 class BookmarkUtilsTest : public ::testing::Test { |
21 public: | 21 public: |
22 virtual void TearDown() OVERRIDE { | 22 virtual void TearDown() OVERRIDE { |
23 ui::Clipboard::DestroyClipboardForCurrentThread(); | 23 ui::Clipboard::DestroyClipboardForCurrentThread(); |
24 } | 24 } |
25 | 25 |
26 private: | 26 private: |
27 // Clipboard requires a message loop. | 27 // Clipboard requires a message loop. |
28 MessageLoopForUI loop; | 28 base::MessageLoopForUI loop; |
29 }; | 29 }; |
30 | 30 |
31 TEST_F(BookmarkUtilsTest, GetBookmarksContainingText) { | 31 TEST_F(BookmarkUtilsTest, GetBookmarksContainingText) { |
32 BookmarkModel model(NULL); | 32 BookmarkModel model(NULL); |
33 const BookmarkNode* n1 = model.AddURL(model.other_node(), | 33 const BookmarkNode* n1 = model.AddURL(model.other_node(), |
34 0, | 34 0, |
35 ASCIIToUTF16("foo bar"), | 35 ASCIIToUTF16("foo bar"), |
36 GURL("http://www.google.com")); | 36 GURL("http://www.google.com")); |
37 const BookmarkNode* n2 = model.AddURL(model.other_node(), | 37 const BookmarkNode* n2 = model.AddURL(model.other_node(), |
38 0, | 38 0, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 // This tests the case where selection doesn't contain any items. | 230 // This tests the case where selection doesn't contain any items. |
231 nodes.clear(); | 231 nodes.clear(); |
232 real_parent = GetParentForNewNodes(model.bookmark_bar_node(), nodes, &index); | 232 real_parent = GetParentForNewNodes(model.bookmark_bar_node(), nodes, &index); |
233 EXPECT_EQ(real_parent, model.bookmark_bar_node()); | 233 EXPECT_EQ(real_parent, model.bookmark_bar_node()); |
234 EXPECT_EQ(2, index); | 234 EXPECT_EQ(2, index); |
235 } | 235 } |
236 | 236 |
237 } // namespace | 237 } // namespace |
238 } // namespace bookmark_utils | 238 } // namespace bookmark_utils |
OLD | NEW |