| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import "ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.h
" |
| 5 #include "components/bookmarks/browser/bookmark_model.h" | 6 #include "components/bookmarks/browser/bookmark_model.h" |
| 6 #import "ios/chrome/browser/browser_state/test_chrome_browser_state.h" | 7 #import "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
| 7 #import "ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.h
" | |
| 8 #include "ios/chrome/browser/ui/bookmarks/bookmark_ios_unittest.h" | 8 #include "ios/chrome/browser/ui/bookmarks/bookmark_ios_unittest.h" |
| 9 #import "ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.h" | 9 #import "ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.h" |
| 10 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" | 10 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" |
| 11 | 11 |
| 12 #if !defined(__has_feature) || !__has_feature(objc_arc) | 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 13 #error "This file requires ARC support." | 13 #error "This file requires ARC support." |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 using bookmarks::BookmarkNode; | 16 using bookmarks::BookmarkNode; |
| 17 | 17 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 33 - (void)ensureAllViewExists { | 33 - (void)ensureAllViewExists { |
| 34 // Do nothing. | 34 // Do nothing. |
| 35 } | 35 } |
| 36 - (void)loadImageService { | 36 - (void)loadImageService { |
| 37 // Do nothing. | 37 // Do nothing. |
| 38 } | 38 } |
| 39 @end | 39 @end |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 using BookmarkHomeViewControllerTest = BookmarkIOSUnitTest; | 43 using BookmarkHomeHandsetViewControllerTest = BookmarkIOSUnitTest; |
| 44 | 44 |
| 45 TEST_F(BookmarkHomeViewControllerTest, DeleteNodesUpdatesEditNodes) { | 45 TEST_F(BookmarkHomeHandsetViewControllerTest, DeleteNodesUpdatesEditNodes) { |
| 46 @autoreleasepool { | 46 @autoreleasepool { |
| 47 const BookmarkNode* mobileNode = _bookmarkModel->mobile_node(); | 47 const BookmarkNode* mobileNode = _bookmarkModel->mobile_node(); |
| 48 const BookmarkNode* f1 = AddFolder(mobileNode, @"f1"); | 48 const BookmarkNode* f1 = AddFolder(mobileNode, @"f1"); |
| 49 const BookmarkNode* a = AddBookmark(mobileNode, @"a"); | 49 const BookmarkNode* a = AddBookmark(mobileNode, @"a"); |
| 50 const BookmarkNode* b = AddBookmark(mobileNode, @"b"); | 50 const BookmarkNode* b = AddBookmark(mobileNode, @"b"); |
| 51 const BookmarkNode* f2 = AddFolder(mobileNode, @"f2"); | 51 const BookmarkNode* f2 = AddFolder(mobileNode, @"f2"); |
| 52 | 52 |
| 53 const BookmarkNode* f1a = AddBookmark(f1, @"f1a"); | 53 const BookmarkNode* f1a = AddBookmark(f1, @"f1a"); |
| 54 AddBookmark(f1, @"f1b"); | 54 AddBookmark(f1, @"f1b"); |
| 55 AddBookmark(f1, @"f1c"); | 55 AddBookmark(f1, @"f1c"); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 76 | 76 |
| 77 // After the deletion, only 'a' and 'f2' should be left. | 77 // After the deletion, only 'a' and 'f2' should be left. |
| 78 std::set<const BookmarkNode*> editingNodes = [controller editNodes]; | 78 std::set<const BookmarkNode*> editingNodes = [controller editNodes]; |
| 79 EXPECT_EQ(editingNodes.size(), 2u); | 79 EXPECT_EQ(editingNodes.size(), 2u); |
| 80 EXPECT_TRUE(editingNodes.find(a) != editingNodes.end()); | 80 EXPECT_TRUE(editingNodes.find(a) != editingNodes.end()); |
| 81 EXPECT_TRUE(editingNodes.find(f2) != editingNodes.end()); | 81 EXPECT_TRUE(editingNodes.find(f2) != editingNodes.end()); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // anonymous namespace | 85 } // anonymous namespace |
| OLD | NEW |