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 "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
16 #include "chrome/browser/history/history_service_factory.h" | 16 #include "chrome/browser/history/history_service_factory.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_commands.h" | 19 #include "chrome/browser/ui/browser_commands.h" |
20 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
21 #include "chrome/browser/ui/browser_tabstrip.h" | 21 #include "chrome/browser/ui/browser_tabstrip.h" |
22 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
23 #include "chrome/browser/ui/chrome_pages.h" | 23 #include "chrome/browser/ui/chrome_pages.h" |
24 #include "chrome/browser/ui/find_bar/find_bar.h" | 24 #include "chrome/browser/ui/find_bar/find_bar.h" |
25 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 25 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
26 #include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h" | 26 #include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h" |
27 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 27 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
28 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 28 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
29 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 30 #include "chrome/browser/ui/webui/md_history_ui.h" |
30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
31 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
32 #include "chrome/test/base/find_in_page_observer.h" | 33 #include "chrome/test/base/find_in_page_observer.h" |
33 #include "chrome/test/base/in_process_browser_test.h" | 34 #include "chrome/test/base/in_process_browser_test.h" |
34 #include "chrome/test/base/ui_test_utils.h" | 35 #include "chrome/test/base/ui_test_utils.h" |
35 #include "components/history/core/browser/history_service.h" | 36 #include "components/history/core/browser/history_service.h" |
36 #include "components/prefs/pref_service.h" | 37 #include "components/prefs/pref_service.h" |
37 #include "content/public/browser/download_manager.h" | 38 #include "content/public/browser/download_manager.h" |
38 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/notification_types.h" | 40 #include "content/public/browser/notification_types.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // chrome://downloads, data directory | 303 // chrome://downloads, data directory |
303 #if defined(OS_WIN) || defined(OS_MACOSX) | 304 #if defined(OS_WIN) || defined(OS_MACOSX) |
304 // Disabled due to crbug.com/175711 and http://crbug.com/419987 | 305 // Disabled due to crbug.com/175711 and http://crbug.com/419987 |
305 #define MAYBE_SearchWithinSpecialURL \ | 306 #define MAYBE_SearchWithinSpecialURL \ |
306 DISABLED_SearchWithinSpecialURL | 307 DISABLED_SearchWithinSpecialURL |
307 #else | 308 #else |
308 #define MAYBE_SearchWithinSpecialURL \ | 309 #define MAYBE_SearchWithinSpecialURL \ |
309 SearchWithinSpecialURL | 310 SearchWithinSpecialURL |
310 #endif | 311 #endif |
311 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { | 312 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { |
| 313 // TODO(tsergeant): Get this test working on MD History, which loads very |
| 314 // asynchronously and causes this test to fail. |
| 315 MdHistoryUI::DisableForTesting(); |
| 316 |
312 WebContents* web_contents = | 317 WebContents* web_contents = |
313 browser()->tab_strip_model()->GetActiveWebContents(); | 318 browser()->tab_strip_model()->GetActiveWebContents(); |
314 | 319 |
315 base::FilePath data_dir = | 320 base::FilePath data_dir = |
316 ui_test_utils::GetTestFilePath(base::FilePath(), base::FilePath()); | 321 ui_test_utils::GetTestFilePath(base::FilePath(), base::FilePath()); |
317 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(data_dir)); | 322 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(data_dir)); |
318 EXPECT_EQ(1, FindInPageASCII(web_contents, "downloads", | 323 EXPECT_EQ(1, FindInPageASCII(web_contents, "downloads", |
319 kFwd, kIgnoreCase, NULL)); | 324 kFwd, kIgnoreCase, NULL)); |
320 | 325 |
321 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); | 326 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 | 1553 |
1549 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); | 1554 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); |
1550 WebContents* web_contents_incognito = | 1555 WebContents* web_contents_incognito = |
1551 browser_incognito->tab_strip_model()->GetActiveWebContents(); | 1556 browser_incognito->tab_strip_model()->GetActiveWebContents(); |
1552 ui_test_utils::FindInPageNotificationObserver observer( | 1557 ui_test_utils::FindInPageNotificationObserver observer( |
1553 web_contents_incognito); | 1558 web_contents_incognito); |
1554 observer.Wait(); | 1559 observer.Wait(); |
1555 EXPECT_EQ(ASCIIToUTF16("bar"), | 1560 EXPECT_EQ(ASCIIToUTF16("bar"), |
1556 GetFindBarTextForBrowser(browser_incognito)); | 1561 GetFindBarTextForBrowser(browser_incognito)); |
1557 } | 1562 } |
OLD | NEW |