| 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 #include <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "components/bookmarks/browser/bookmark_model.h" | 11 #include "components/bookmarks/browser/bookmark_model.h" |
| 12 #include "ios/chrome/browser/experimental_flags.h" | 12 #include "ios/chrome/browser/experimental_flags.h" |
| 13 #include "ios/chrome/browser/ui/bookmarks/bookmark_ios_unittest.h" | 13 #include "ios/chrome/browser/ui/bookmarks/bookmark_ios_unittest.h" |
| 14 #import "ios/chrome/browser/ui/bookmarks/bookmark_menu_item.h" | 14 #import "ios/chrome/browser/ui/bookmarks/bookmark_menu_item.h" |
| 15 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" | 15 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" |
| 16 #include "testing/gtest_mac.h" | 16 #include "testing/gtest_mac.h" |
| 17 | 17 |
| 18 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 19 #error "This file requires ARC support." |
| 20 #endif |
| 21 |
| 18 using bookmarks::BookmarkNode; | 22 using bookmarks::BookmarkNode; |
| 19 | 23 |
| 20 namespace { | 24 namespace { |
| 21 | 25 |
| 22 using bookmark_utils_ios::NodesSection; | 26 using bookmark_utils_ios::NodesSection; |
| 23 | 27 |
| 24 class BookmarkIOSUtilsUnitTest : public BookmarkIOSUnitTest { | 28 class BookmarkIOSUtilsUnitTest : public BookmarkIOSUnitTest { |
| 25 protected: | 29 protected: |
| 26 base::Time timeFromEpoch(int days, int hours) { | 30 base::Time timeFromEpoch(int days, int hours) { |
| 27 return base::Time::UnixEpoch() + base::TimeDelta::FromDays(days) + | 31 return base::Time::UnixEpoch() + base::TimeDelta::FromDays(days) + |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 vector1.push_back(bookmark1); | 391 vector1.push_back(bookmark1); |
| 388 vector2.insert(vector2.begin(), bookmark1); | 392 vector2.insert(vector2.begin(), bookmark1); |
| 389 missingNodesIndices = | 393 missingNodesIndices = |
| 390 bookmark_utils_ios::MissingNodesIndices(vector1, vector2); | 394 bookmark_utils_ios::MissingNodesIndices(vector1, vector2); |
| 391 EXPECT_EQ(2u, missingNodesIndices.size()); | 395 EXPECT_EQ(2u, missingNodesIndices.size()); |
| 392 EXPECT_EQ(2u, missingNodesIndices[0]); | 396 EXPECT_EQ(2u, missingNodesIndices[0]); |
| 393 EXPECT_EQ(3u, missingNodesIndices[1]); | 397 EXPECT_EQ(3u, missingNodesIndices[1]); |
| 394 } | 398 } |
| 395 | 399 |
| 396 } // namespace | 400 } // namespace |
| OLD | NEW |