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

Side by Side Diff: chrome/browser/bookmarks/managed_bookmark_service_unittest.cc

Issue 2326983003: Re-enable ManagedBookmarkServiceTest.EmptyManagedNode on Android. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/bookmarks/managed/managed_bookmark_service.h" 5 #include "components/bookmarks/managed/managed_bookmark_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 content::TestBrowserThreadBundle thread_bundle_; 134 content::TestBrowserThreadBundle thread_bundle_;
135 TestingProfile profile_; 135 TestingProfile profile_;
136 syncable_prefs::TestingPrefServiceSyncable* prefs_; 136 syncable_prefs::TestingPrefServiceSyncable* prefs_;
137 bookmarks::MockBookmarkModelObserver observer_; 137 bookmarks::MockBookmarkModelObserver observer_;
138 ManagedBookmarkService* managed_; 138 ManagedBookmarkService* managed_;
139 BookmarkModel* model_; 139 BookmarkModel* model_;
140 140
141 DISALLOW_COPY_AND_ASSIGN(ManagedBookmarkServiceTest); 141 DISALLOW_COPY_AND_ASSIGN(ManagedBookmarkServiceTest);
142 }; 142 };
143 143
144 // Crashes on Android only. http://crbug.com/644570 144 TEST_F(ManagedBookmarkServiceTest, EmptyManagedNode) {
145 #if defined(OS_ANDROID)
146 #define MAYBE_EmptyManagedNode DISABLED_EmptyManagedNode
147 #else
148 #define MAYBE_EmptyManagedNode EmptyManagedNode
149 #endif
150 TEST_F(ManagedBookmarkServiceTest, MAYBE_EmptyManagedNode) {
151 // Verifies that the managed node is empty and invisible when the policy is 145 // Verifies that the managed node is empty and invisible when the policy is
152 // not set. 146 // not set.
153 model_->RemoveObserver(&observer_); 147 model_->RemoveObserver(&observer_);
154 prefs_->RemoveManagedPref(bookmarks::prefs::kManagedBookmarks); 148 prefs_->RemoveManagedPref(bookmarks::prefs::kManagedBookmarks);
155 ResetModel(); 149 ResetModel();
156 150
157 ASSERT_TRUE(managed_->managed_node()); 151 ASSERT_TRUE(managed_->managed_node());
158 EXPECT_TRUE(managed_->managed_node()->empty()); 152 EXPECT_TRUE(managed_->managed_node()->empty());
159 EXPECT_FALSE(managed_->managed_node()->IsVisible()); 153 EXPECT_FALSE(managed_->managed_node()->IsVisible());
160 } 154 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 const BookmarkNode* managed_node = managed_->managed_node()->GetChild(0); 287 const BookmarkNode* managed_node = managed_->managed_node()->GetChild(0);
294 ASSERT_TRUE(managed_node); 288 ASSERT_TRUE(managed_node);
295 289
296 std::vector<const BookmarkNode*> nodes; 290 std::vector<const BookmarkNode*> nodes;
297 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); 291 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node()));
298 nodes.push_back(user_node); 292 nodes.push_back(user_node);
299 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); 293 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node()));
300 nodes.push_back(managed_node); 294 nodes.push_back(managed_node);
301 EXPECT_TRUE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); 295 EXPECT_TRUE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node()));
302 } 296 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698