Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2579)

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_position_cache_unittest.mm

Issue 2586993002: Upstream Chrome on iOS source code [3/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/bookmark_position_cache.mm ('k') | ios/chrome/browser/ui/bookmarks/bookmark_promo_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698