| 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 "ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h" | 5 #include "ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "testing/gtest_mac.h" | 7 #include "testing/gtest_mac.h" |
| 8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
| 9 namespace { | 13 namespace { |
| 10 | 14 |
| 11 TEST(BookmarkPositionCacheTest, TestMenuItemFolderCoding) { | 15 TEST(BookmarkPositionCacheTest, TestMenuItemFolderCoding) { |
| 12 BookmarkPositionCache* cache = | 16 BookmarkPositionCache* cache = |
| 13 [BookmarkPositionCache cacheForMenuItemFolderWithPosition:1010101 | 17 [BookmarkPositionCache cacheForMenuItemFolderWithPosition:1010101 |
| 14 folderId:6363]; | 18 folderId:6363]; |
| 15 | 19 |
| 16 NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache]; | 20 NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache]; |
| 17 BookmarkPositionCache* cache2 = | 21 BookmarkPositionCache* cache2 = |
| 18 [NSKeyedUnarchiver unarchiveObjectWithData:data]; | 22 [NSKeyedUnarchiver unarchiveObjectWithData:data]; |
| 19 EXPECT_NSEQ(cache, cache2); | 23 EXPECT_NSEQ(cache, cache2); |
| 20 } | 24 } |
| 21 | 25 |
| 22 } // anonymous namespace | 26 } // anonymous namespace |
| OLD | NEW |