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

Side by Side Diff: ios/chrome/browser/ui/bookmarks/bookmark_position_cache_unittest.mm

Issue 2666833003: Revert of Removing "All Bookmarks" (Closed)
Patch Set: Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
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 namespace { 9 namespace {
10 10
11 TEST(BookmarkPositionCacheTest, TestMenuItemAllCoding) {
12 BookmarkPositionCache* cache =
13 [BookmarkPositionCache cacheForMenuItemAllWithPosition:23.2];
14
15 NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache];
16 BookmarkPositionCache* cache2 =
17 [NSKeyedUnarchiver unarchiveObjectWithData:data];
18 EXPECT_NSEQ(cache, cache2);
19 }
20
11 TEST(BookmarkPositionCacheTest, TestMenuItemFolderCoding) { 21 TEST(BookmarkPositionCacheTest, TestMenuItemFolderCoding) {
12 BookmarkPositionCache* cache = 22 BookmarkPositionCache* cache =
13 [BookmarkPositionCache cacheForMenuItemFolderWithPosition:1010101 23 [BookmarkPositionCache cacheForMenuItemFolderWithPosition:1010101
14 folderId:6363]; 24 folderId:6363];
15 25
16 NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache]; 26 NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache];
17 BookmarkPositionCache* cache2 = 27 BookmarkPositionCache* cache2 =
18 [NSKeyedUnarchiver unarchiveObjectWithData:data]; 28 [NSKeyedUnarchiver unarchiveObjectWithData:data];
19 EXPECT_NSEQ(cache, cache2); 29 EXPECT_NSEQ(cache, cache2);
20 } 30 }
21 31
22 } // anonymous namespace 32 } // anonymous namespace
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/bookmark_position_cache.mm ('k') | ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698