| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/search_engines/template_url_service.h" | 5 #include "chrome/browser/search_engines/template_url_service.h" |
| 6 #include "chrome/browser/search_engines/template_url_service_factory.h" | 6 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 8 #include "chrome/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
| 9 #include "chrome/test/base/browser_with_test_window_test.h" | 9 #include "chrome/test/base/browser_with_test_window_test.h" |
| 10 #include "content/public/browser/navigation_entry.h" | 10 #include "content/public/browser/navigation_entry.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // TemplateURLService is normally NULL during testing. Instant extended | 50 // TemplateURLService is normally NULL during testing. Instant extended |
| 51 // needs this service so set a custom factory function. | 51 // needs this service so set a custom factory function. |
| 52 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( | 52 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( |
| 53 profile, &BookmarkInstantExtendedTest::CreateTemplateURLService); | 53 profile, &BookmarkInstantExtendedTest::CreateTemplateURLService); |
| 54 return profile; | 54 return profile; |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 static KeyedService* CreateTemplateURLService( | 58 static KeyedService* CreateTemplateURLService( |
| 59 content::BrowserContext* profile) { | 59 content::BrowserContext* profile) { |
| 60 return new TemplateURLService(static_cast<Profile*>(profile), NULL); | 60 return new TemplateURLService(static_cast<Profile*>(profile), NULL, |
| 61 base::Closure()); |
| 61 } | 62 } |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest); | 64 DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 // Verify that in instant extended mode the detached bookmark bar is visible on | 67 // Verify that in instant extended mode the detached bookmark bar is visible on |
| 67 // the new tab page. | 68 // the new tab page. |
| 68 TEST_F(BookmarkInstantExtendedTest, DetachedBookmarkBarOnNTP) { | 69 TEST_F(BookmarkInstantExtendedTest, DetachedBookmarkBarOnNTP) { |
| 69 AddTab(browser(), GURL(chrome::kChromeUINewTabURL)); | 70 AddTab(browser(), GURL(chrome::kChromeUINewTabURL)); |
| 70 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state()); | 71 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state()); |
| 71 } | 72 } |
| OLD | NEW |