#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
#include "base/prefs/pref_service.h"
-#include "chrome/browser/bookmarks/bookmark_test_helpers.h"
+#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/search/search.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/app_list/app_list_util.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
+#include "components/bookmarks/core/test/bookmark_test_helpers.h"
#include "ui/views/controls/button/text_button.h"
-typedef BrowserWithTestWindowTest BookmarkBarViewTest;
-
-// Verify that the apps shortcut is never visible without instant extended.
-TEST_F(BookmarkBarViewTest, NoAppsShortcutWithoutInstantExtended) {
- ScopedTestingLocalState local_state(TestingBrowserProcess::GetGlobal());
- profile()->CreateBookmarkModel(true);
- test::WaitForBookmarkModelToLoad(profile());
- BookmarkBarView bookmark_bar_view(browser(), NULL);
- bookmark_bar_view.set_owned_by_client();
- EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible());
- browser()->profile()->GetPrefs()->SetBoolean(
- prefs::kShowAppsShortcutInBookmarkBar, true);
- EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible());
-}
-
class BookmarkBarViewInstantExtendedTest : public BrowserWithTestWindowTest {
public:
BookmarkBarViewInstantExtendedTest() {
- chrome::EnableInstantExtendedAPIForTesting();
}
protected:
}
private:
- static BrowserContextKeyedService* CreateTemplateURLService(
+ static KeyedService* CreateTemplateURLService(
content::BrowserContext* profile) {
return new TemplateURLService(static_cast<Profile*>(profile));
}
TEST_F(BookmarkBarViewInstantExtendedTest, AppsShortcutVisibility) {
ScopedTestingLocalState local_state(TestingBrowserProcess::GetGlobal());
profile()->CreateBookmarkModel(true);
- test::WaitForBookmarkModelToLoad(profile());
+ test::WaitForBookmarkModelToLoad(
+ BookmarkModelFactory::GetForProfile(profile()));
BookmarkBarView bookmark_bar_view(browser(), NULL);
bookmark_bar_view.set_owned_by_client();
browser()->profile()->GetPrefs()->SetBoolean(