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

Unified Diff: chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc

Issue 769153007: Managed bookmarks for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build (Android & unit_tests) Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc
diff --git a/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc b/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc
index fb59a2c0e2cded381e5e883bae60e6987b211660..7adc3d9e0912689759dd37e9962114d6f768e686 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc
+++ b/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc
@@ -24,25 +24,41 @@ using bookmarks::BookmarkModel;
#define MAYBE_Bookmarks Bookmarks
#endif
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Bookmarks) {
- // Add test managed bookmarks to verify that the bookmarks API can read them
- // and can't modify them.
+ // Add test managed and supervised bookmarks to verify that the bookmarks API
+ // can read them and can't modify them.
Profile* profile = browser()->profile();
BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile);
ChromeBookmarkClient* client =
ChromeBookmarkClientFactory::GetForProfile(profile);
bookmarks::test::WaitForBookmarkModelToLoad(model);
- base::ListValue list;
- base::DictionaryValue* node = new base::DictionaryValue();
- node->SetString("name", "Managed Bookmark");
- node->SetString("url", "http://www.chromium.org");
- list.Append(node);
- node = new base::DictionaryValue();
- node->SetString("name", "Managed Folder");
- node->Set("children", new base::ListValue());
- list.Append(node);
- profile->GetPrefs()->Set(bookmarks::prefs::kManagedBookmarks, list);
- ASSERT_EQ(2, client->managed_node()->child_count());
+ {
+ base::ListValue list;
+ base::DictionaryValue* node = new base::DictionaryValue();
+ node->SetString("name", "Managed Bookmark");
+ node->SetString("url", "http://www.chromium.org");
+ list.Append(node);
+ node = new base::DictionaryValue();
+ node->SetString("name", "Managed Folder");
+ node->Set("children", new base::ListValue());
+ list.Append(node);
+ profile->GetPrefs()->Set(bookmarks::prefs::kManagedBookmarks, list);
+ ASSERT_EQ(2, client->managed_node()->child_count());
+ }
+
+ {
+ base::ListValue list;
+ base::DictionaryValue* node = new base::DictionaryValue();
+ node->SetString("name", "Supervised Bookmark");
+ node->SetString("url", "http://www.pbskids.org");
+ list.Append(node);
+ node = new base::DictionaryValue();
+ node->SetString("name", "Supervised Folder");
+ node->Set("children", new base::ListValue());
+ list.Append(node);
+ profile->GetPrefs()->Set(bookmarks::prefs::kSupervisedBookmarks, list);
+ ASSERT_EQ(2, client->supervised_node()->child_count());
+ }
ASSERT_TRUE(RunExtensionTest("bookmarks")) << message_;
}

Powered by Google App Engine
This is Rietveld 408576698