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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
9 #include "components/bookmarks/browser/bookmark_model.h" | 9 #include "components/bookmarks/browser/bookmark_model.h" |
10 #include "components/bookmarks/test/test_bookmark_client.h" | 10 #include "components/bookmarks/test/test_bookmark_client.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 13 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
14 | 14 |
15 using base::ASCIIToUTF16; | 15 using base::ASCIIToUTF16; |
16 using bookmarks::BookmarkModel; | 16 using bookmarks::BookmarkModel; |
| 17 using bookmarks::BookmarkNode; |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
20 TEST(BookmarkUIUtilsTest, HasBookmarkURLs) { | 21 TEST(BookmarkUIUtilsTest, HasBookmarkURLs) { |
21 bookmarks::TestBookmarkClient client; | 22 bookmarks::TestBookmarkClient client; |
22 scoped_ptr<BookmarkModel> model(client.CreateModel()); | 23 scoped_ptr<BookmarkModel> model(client.CreateModel()); |
23 | 24 |
24 std::vector<const BookmarkNode*> nodes; | 25 std::vector<const BookmarkNode*> nodes; |
25 | 26 |
26 // This tests that |nodes| contains an URL. | 27 // This tests that |nodes| contains an URL. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 const BookmarkNode* subfolder1 = | 114 const BookmarkNode* subfolder1 = |
114 model->AddFolder(folder1, 0, ASCIIToUTF16("Subfolder1")); | 115 model->AddFolder(folder1, 0, ASCIIToUTF16("Subfolder1")); |
115 | 116 |
116 // Now add the URL to that |subfolder1|. | 117 // Now add the URL to that |subfolder1|. |
117 model->AddURL(subfolder1, 0, ASCIIToUTF16("BAR"), GURL("http://bar-foo.com")); | 118 model->AddURL(subfolder1, 0, ASCIIToUTF16("BAR"), GURL("http://bar-foo.com")); |
118 EXPECT_FALSE(chrome::HasBookmarkURLsAllowedInIncognitoMode(nodes, &profile)); | 119 EXPECT_FALSE(chrome::HasBookmarkURLsAllowedInIncognitoMode(nodes, &profile)); |
119 } | 120 } |
120 | 121 |
121 } // namespace | 122 } // namespace |
122 #endif | 123 #endif |
OLD | NEW |