| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/test/scoped_feature_list.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "chrome/app/chrome_command_ids.h" | 16 #include "chrome/app/chrome_command_ids.h" |
| 16 #include "chrome/browser/history/history_service_factory.h" | 17 #include "chrome/browser/history/history_service_factory.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_commands.h" | 20 #include "chrome/browser/ui/browser_commands.h" |
| 20 #include "chrome/browser/ui/browser_finder.h" | 21 #include "chrome/browser/ui/browser_finder.h" |
| 21 #include "chrome/browser/ui/browser_tabstrip.h" | 22 #include "chrome/browser/ui/browser_tabstrip.h" |
| 22 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
| 23 #include "chrome/browser/ui/chrome_pages.h" | 24 #include "chrome/browser/ui/chrome_pages.h" |
| 24 #include "chrome/browser/ui/find_bar/find_bar.h" | 25 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 25 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 26 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 26 #include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h" | 27 #include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h" |
| 27 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 28 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 28 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 29 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 30 #include "chrome/browser/ui/webui/md_history_ui.h" | 31 #include "chrome/browser/ui/webui/md_history_ui.h" |
| 32 #include "chrome/common/chrome_features.h" |
| 31 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 32 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 33 #include "chrome/test/base/find_in_page_observer.h" | 35 #include "chrome/test/base/find_in_page_observer.h" |
| 34 #include "chrome/test/base/in_process_browser_test.h" | 36 #include "chrome/test/base/in_process_browser_test.h" |
| 35 #include "chrome/test/base/ui_test_utils.h" | 37 #include "chrome/test/base/ui_test_utils.h" |
| 36 #include "components/history/core/browser/history_service.h" | 38 #include "components/history/core/browser/history_service.h" |
| 37 #include "components/prefs/pref_service.h" | 39 #include "components/prefs/pref_service.h" |
| 38 #include "content/public/browser/download_manager.h" | 40 #include "content/public/browser/download_manager.h" |
| 39 #include "content/public/browser/notification_service.h" | 41 #include "content/public/browser/notification_service.h" |
| 40 #include "content/public/browser/notification_types.h" | 42 #include "content/public/browser/notification_types.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // Disabled on Win due to http://crbug.com/661013 | 308 // Disabled on Win due to http://crbug.com/661013 |
| 307 #define MAYBE_SearchWithinSpecialURL \ | 309 #define MAYBE_SearchWithinSpecialURL \ |
| 308 DISABLED_SearchWithinSpecialURL | 310 DISABLED_SearchWithinSpecialURL |
| 309 #else | 311 #else |
| 310 #define MAYBE_SearchWithinSpecialURL \ | 312 #define MAYBE_SearchWithinSpecialURL \ |
| 311 SearchWithinSpecialURL | 313 SearchWithinSpecialURL |
| 312 #endif | 314 #endif |
| 313 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { | 315 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { |
| 314 // TODO(tsergeant): Get this test working on MD History, which loads very | 316 // TODO(tsergeant): Get this test working on MD History, which loads very |
| 315 // asynchronously and causes this test to fail. | 317 // asynchronously and causes this test to fail. |
| 316 MdHistoryUI::SetEnabledForTesting(false); | 318 base::test::ScopedFeatureList scoped_feature_list; |
| 319 scoped_feature_list.InitAndDisableFeature(features::kMaterialDesignHistory); |
| 317 | 320 |
| 318 WebContents* web_contents = | 321 WebContents* web_contents = |
| 319 browser()->tab_strip_model()->GetActiveWebContents(); | 322 browser()->tab_strip_model()->GetActiveWebContents(); |
| 320 | 323 |
| 321 base::FilePath data_dir = | 324 base::FilePath data_dir = |
| 322 ui_test_utils::GetTestFilePath(base::FilePath(), base::FilePath()); | 325 ui_test_utils::GetTestFilePath(base::FilePath(), base::FilePath()); |
| 323 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(data_dir)); | 326 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(data_dir)); |
| 324 EXPECT_EQ(1, FindInPageASCII(web_contents, "downloads", | 327 EXPECT_EQ(1, FindInPageASCII(web_contents, "downloads", |
| 325 kFwd, kIgnoreCase, NULL)); | 328 kFwd, kIgnoreCase, NULL)); |
| 326 | 329 |
| (...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 | 1562 |
| 1560 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); | 1563 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); |
| 1561 WebContents* web_contents_incognito = | 1564 WebContents* web_contents_incognito = |
| 1562 browser_incognito->tab_strip_model()->GetActiveWebContents(); | 1565 browser_incognito->tab_strip_model()->GetActiveWebContents(); |
| 1563 ui_test_utils::FindInPageNotificationObserver observer( | 1566 ui_test_utils::FindInPageNotificationObserver observer( |
| 1564 web_contents_incognito); | 1567 web_contents_incognito); |
| 1565 observer.Wait(); | 1568 observer.Wait(); |
| 1566 EXPECT_EQ(ASCIIToUTF16("bar"), | 1569 EXPECT_EQ(ASCIIToUTF16("bar"), |
| 1567 GetFindBarTextForBrowser(browser_incognito)); | 1570 GetFindBarTextForBrowser(browser_incognito)); |
| 1568 } | 1571 } |
| OLD | NEW |