Index: ios/chrome/browser/ui/bookmarks/bookmark_position_cache_unittest.mm |
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_position_cache_unittest.mm b/ios/chrome/browser/ui/bookmarks/bookmark_position_cache_unittest.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..308582011d19b9eba6ab893a82c85f31218475e6 |
--- /dev/null |
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_position_cache_unittest.mm |
@@ -0,0 +1,32 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+#include "testing/gtest_mac.h" |
+ |
+namespace { |
+ |
+TEST(BookmarkPositionCacheTest, TestMenuItemAllCoding) { |
+ BookmarkPositionCache* cache = |
+ [BookmarkPositionCache cacheForMenuItemAllWithPosition:23.2]; |
+ |
+ NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache]; |
+ BookmarkPositionCache* cache2 = |
+ [NSKeyedUnarchiver unarchiveObjectWithData:data]; |
+ EXPECT_NSEQ(cache, cache2); |
+} |
+ |
+TEST(BookmarkPositionCacheTest, TestMenuItemFolderCoding) { |
+ BookmarkPositionCache* cache = |
+ [BookmarkPositionCache cacheForMenuItemFolderWithPosition:1010101 |
+ folderId:6363]; |
+ |
+ NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache]; |
+ BookmarkPositionCache* cache2 = |
+ [NSKeyedUnarchiver unarchiveObjectWithData:data]; |
+ EXPECT_NSEQ(cache, cache2); |
+} |
+ |
+} // anonymous namespace |