| 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> |
| 11 #include <tuple> | 11 #include <tuple> |
| 12 | 12 |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "chrome/browser/signin/fake_signin_manager_builder.h" | 15 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
| 16 #include "chrome/browser/signin/signin_manager_factory.h" | 16 #include "chrome/browser/signin/signin_manager_factory.h" |
| 17 #include "chrome/browser/sync/profile_sync_service_factory.h" | 17 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 18 #include "chrome/browser/sync/profile_sync_test_util.h" | 18 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 19 #include "chrome/browser/ui/search/search_ipc_router.h" | 19 #include "chrome/browser/ui/search/search_ipc_router.h" |
| 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 21 #include "chrome/common/render_messages.h" | 21 #include "chrome/common/render_messages.h" |
| 22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 23 #include "chrome/grit/generated_resources.h" | 23 #include "chrome/grit/generated_resources.h" |
| 24 #include "chrome/test/base/browser_with_test_window_test.h" | 24 #include "chrome/test/base/browser_with_test_window_test.h" |
| 25 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 25 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 26 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
| 27 #include "components/browser_sync/browser/profile_sync_service.h" | 27 #include "components/browser_sync/profile_sync_service.h" |
| 28 #include "components/omnibox/common/omnibox_focus_state.h" | 28 #include "components/omnibox/common/omnibox_focus_state.h" |
| 29 #include "components/strings/grit/components_strings.h" | 29 #include "components/strings/grit/components_strings.h" |
| 30 #include "content/public/browser/navigation_controller.h" | 30 #include "content/public/browser/navigation_controller.h" |
| 31 #include "content/public/browser/navigation_entry.h" | 31 #include "content/public/browser/navigation_entry.h" |
| 32 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 33 #include "content/public/test/mock_render_process_host.h" | 33 #include "content/public/test/mock_render_process_host.h" |
| 34 #include "ipc/ipc_message.h" | 34 #include "ipc/ipc_message.h" |
| 35 #include "ipc/ipc_test_sink.h" | 35 #include "ipc/ipc_test_sink.h" |
| 36 #include "net/base/net_errors.h" | 36 #include "net/base/net_errors.h" |
| 37 #include "testing/gmock/include/gmock/gmock.h" | 37 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 }; | 337 }; |
| 338 | 338 |
| 339 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) { | 339 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) { |
| 340 TabTitleObserver title_observer(web_contents()); | 340 TabTitleObserver title_observer(web_contents()); |
| 341 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL)); | 341 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL)); |
| 342 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); | 342 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); |
| 343 EXPECT_EQ(title, title_observer.title_on_start()); | 343 EXPECT_EQ(title, title_observer.title_on_start()); |
| 344 EXPECT_EQ(title, title_observer.title_on_commit()); | 344 EXPECT_EQ(title, title_observer.title_on_commit()); |
| 345 EXPECT_EQ(title, web_contents()->GetTitle()); | 345 EXPECT_EQ(title, web_contents()->GetTitle()); |
| 346 } | 346 } |
| OLD | NEW |