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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc

Issue 490123003: Move bookmark_pref_names.* into bookmarks namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 6 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
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 "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 EXPECT_TRUE(controller->IsCommandVisible(IDC_BOOKMARK_BAR_NEW_FOLDER)); 365 EXPECT_TRUE(controller->IsCommandVisible(IDC_BOOKMARK_BAR_NEW_FOLDER));
366 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_NEW_FOLDER)->visible()); 366 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_NEW_FOLDER)->visible());
367 367
368 // Now set the managed bookmarks policy. 368 // Now set the managed bookmarks policy.
369 base::DictionaryValue* dict = new base::DictionaryValue; 369 base::DictionaryValue* dict = new base::DictionaryValue;
370 dict->SetString("name", "Google"); 370 dict->SetString("name", "Google");
371 dict->SetString("url", "http://google.com"); 371 dict->SetString("url", "http://google.com");
372 base::ListValue list; 372 base::ListValue list;
373 list.Append(dict); 373 list.Append(dict);
374 EXPECT_TRUE(client->managed_node()->empty()); 374 EXPECT_TRUE(client->managed_node()->empty());
375 profile_->GetPrefs()->Set(prefs::kManagedBookmarks, list); 375 profile_->GetPrefs()->Set(bookmarks::prefs::kManagedBookmarks, list);
376 EXPECT_FALSE(client->managed_node()->empty()); 376 EXPECT_FALSE(client->managed_node()->empty());
377 377
378 // New context menus now show the "Show managed bookmarks" option. 378 // New context menus now show the "Show managed bookmarks" option.
379 controller.reset(new BookmarkContextMenu( 379 controller.reset(new BookmarkContextMenu(
380 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false)); 380 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false));
381 EXPECT_TRUE(controller->IsCommandVisible(IDC_BOOKMARK_BAR_NEW_FOLDER)); 381 EXPECT_TRUE(controller->IsCommandVisible(IDC_BOOKMARK_BAR_NEW_FOLDER));
382 EXPECT_TRUE( 382 EXPECT_TRUE(
383 controller->IsCommandVisible(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS)); 383 controller->IsCommandVisible(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS));
384 menu = controller->menu(); 384 menu = controller->menu();
385 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_NEW_FOLDER)->visible()); 385 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_NEW_FOLDER)->visible());
386 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS) 386 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS)
387 ->visible()); 387 ->visible());
388 } 388 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698