| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/search/search_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 SigninManagerFactory::GetForProfile(profile())); | 91 SigninManagerFactory::GetForProfile(profile())); |
| 92 | 92 |
| 93 if (!username.empty()) { | 93 if (!username.empty()) { |
| 94 ASSERT_TRUE(signin_manager); | 94 ASSERT_TRUE(signin_manager); |
| 95 signin_manager->SetAuthenticatedAccountInfo(username, username); | 95 signin_manager->SetAuthenticatedAccountInfo(username, username); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 // Configure the account to |sync_history| or not. | 99 // Configure the account to |sync_history| or not. |
| 100 void SetHistorySync(bool sync_history) { | 100 void SetHistorySync(bool sync_history) { |
| 101 ProfileSyncServiceMock* sync_service = static_cast<ProfileSyncServiceMock*>( | 101 browser_sync::ProfileSyncServiceMock* sync_service = |
| 102 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile())); | 102 static_cast<browser_sync::ProfileSyncServiceMock*>( |
| 103 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile())); |
| 103 | 104 |
| 104 syncer::ModelTypeSet result; | 105 syncer::ModelTypeSet result; |
| 105 if (sync_history) { | 106 if (sync_history) { |
| 106 result.Put(syncer::HISTORY_DELETE_DIRECTIVES); | 107 result.Put(syncer::HISTORY_DELETE_DIRECTIVES); |
| 107 } | 108 } |
| 108 EXPECT_CALL(*sync_service, GetPreferredDataTypes()) | 109 EXPECT_CALL(*sync_service, GetPreferredDataTypes()) |
| 109 .WillRepeatedly(Return(result)); | 110 .WillRepeatedly(Return(result)); |
| 110 } | 111 } |
| 111 | 112 |
| 112 bool MessageWasSent(uint32_t id) { | 113 bool MessageWasSent(uint32_t id) { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 }; | 338 }; |
| 338 | 339 |
| 339 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) { | 340 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) { |
| 340 TabTitleObserver title_observer(web_contents()); | 341 TabTitleObserver title_observer(web_contents()); |
| 341 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL)); | 342 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL)); |
| 342 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); | 343 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); |
| 343 EXPECT_EQ(title, title_observer.title_on_start()); | 344 EXPECT_EQ(title, title_observer.title_on_start()); |
| 344 EXPECT_EQ(title, title_observer.title_on_commit()); | 345 EXPECT_EQ(title, title_observer.title_on_commit()); |
| 345 EXPECT_EQ(title, web_contents()->GetTitle()); | 346 EXPECT_EQ(title, web_contents()->GetTitle()); |
| 346 } | 347 } |
| OLD | NEW |