| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "content/public/browser/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
| 36 #include "content/public/browser/notification_types.h" | 36 #include "content/public/browser/notification_types.h" |
| 37 #include "content/public/browser/render_view_host.h" | 37 #include "content/public/browser/render_view_host.h" |
| 38 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
| 39 #include "content/public/browser/web_contents_view.h" | 39 #include "content/public/browser/web_contents_view.h" |
| 40 #include "content/public/test/browser_test_utils.h" | 40 #include "content/public/test/browser_test_utils.h" |
| 41 #include "net/base/net_util.h" | 41 #include "net/base/net_util.h" |
| 42 #include "ui/base/accelerators/accelerator.h" | 42 #include "ui/base/accelerators/accelerator.h" |
| 43 #include "ui/events/keycodes/keyboard_codes.h" | 43 #include "ui/events/keycodes/keyboard_codes.h" |
| 44 | 44 |
| 45 #if defined(OS_WIN) && defined(USE_AURA) | 45 #if defined(OS_WIN) |
| 46 #include "content/public/browser/web_contents_view.h" | 46 #include "content/public/browser/web_contents_view.h" |
| 47 #include "ui/aura/root_window.h" | 47 #include "ui/aura/root_window.h" |
| 48 #include "ui/aura/window.h" | 48 #include "ui/aura/window.h" |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 using base::ASCIIToUTF16; | 51 using base::ASCIIToUTF16; |
| 52 using base::WideToUTF16; | 52 using base::WideToUTF16; |
| 53 using content::NavigationController; | 53 using content::NavigationController; |
| 54 using content::WebContents; | 54 using content::WebContents; |
| 55 | 55 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 ui_test_utils::NavigateToURL(browser(), urls[i]); | 285 ui_test_utils::NavigateToURL(browser(), urls[i]); |
| 286 EXPECT_EQ(1, FindInPageWchar(web_contents, L"cat", | 286 EXPECT_EQ(1, FindInPageWchar(web_contents, L"cat", |
| 287 kFwd, kIgnoreCase, NULL)); | 287 kFwd, kIgnoreCase, NULL)); |
| 288 EXPECT_EQ(0, FindInPageWchar(web_contents, L"bat", | 288 EXPECT_EQ(0, FindInPageWchar(web_contents, L"bat", |
| 289 kFwd, kIgnoreCase, NULL)); | 289 kFwd, kIgnoreCase, NULL)); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 // Verify search for text within special URLs such as chrome:history, | 293 // Verify search for text within special URLs such as chrome:history, |
| 294 // chrome://downloads, data directory | 294 // chrome://downloads, data directory |
| 295 #if defined(OS_WIN) && defined(USE_AURA) | 295 #if defined(OS_WIN) |
| 296 // Disabled due to crbug.com/175711 | 296 // Disabled due to crbug.com/175711 |
| 297 #define MAYBE_SearchWithinSpecialURL \ | 297 #define MAYBE_SearchWithinSpecialURL \ |
| 298 DISABLED_SearchWithinSpecialURL | 298 DISABLED_SearchWithinSpecialURL |
| 299 #else | 299 #else |
| 300 #define MAYBE_SearchWithinSpecialURL \ | 300 #define MAYBE_SearchWithinSpecialURL \ |
| 301 SearchWithinSpecialURL | 301 SearchWithinSpecialURL |
| 302 #endif | 302 #endif |
| 303 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { | 303 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { |
| 304 WebContents* web_contents = | 304 WebContents* web_contents = |
| 305 browser()->tab_strip_model()->GetActiveWebContents(); | 305 browser()->tab_strip_model()->GetActiveWebContents(); |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1547 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); | 1547 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); |
| 1548 WebContents* web_contents_incognito = | 1548 WebContents* web_contents_incognito = |
| 1549 browser_incognito->tab_strip_model()->GetActiveWebContents(); | 1549 browser_incognito->tab_strip_model()->GetActiveWebContents(); |
| 1550 ui_test_utils::FindInPageNotificationObserver observer( | 1550 ui_test_utils::FindInPageNotificationObserver observer( |
| 1551 web_contents_incognito); | 1551 web_contents_incognito); |
| 1552 observer.Wait(); | 1552 observer.Wait(); |
| 1553 EXPECT_EQ(ASCIIToUTF16("bar"), | 1553 EXPECT_EQ(ASCIIToUTF16("bar"), |
| 1554 GetFindBarTextForBrowser(browser_incognito)); | 1554 GetFindBarTextForBrowser(browser_incognito)); |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 #if defined(OS_WIN) && defined(USE_AURA) | 1557 #if defined(OS_WIN) |
| 1558 | 1558 |
| 1559 BOOL CALLBACK EnumerateChildren(HWND hwnd, LPARAM l_param) { | 1559 BOOL CALLBACK EnumerateChildren(HWND hwnd, LPARAM l_param) { |
| 1560 HWND* child = reinterpret_cast<HWND*>(l_param); | 1560 HWND* child = reinterpret_cast<HWND*>(l_param); |
| 1561 *child = hwnd; | 1561 *child = hwnd; |
| 1562 // The first child window is the plugin, then its children. So stop | 1562 // The first child window is the plugin, then its children. So stop |
| 1563 // enumerating after the first callback. | 1563 // enumerating after the first callback. |
| 1564 return FALSE; | 1564 return FALSE; |
| 1565 } | 1565 } |
| 1566 | 1566 |
| 1567 // Ensure that the find bar is always over a windowed NPAPI plugin. | 1567 // Ensure that the find bar is always over a windowed NPAPI plugin. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 ASSERT_EQ(result, SIMPLEREGION); | 1617 ASSERT_EQ(result, SIMPLEREGION); |
| 1618 bool rects_equal = | 1618 bool rects_equal = |
| 1619 region_before.left == region_after.left && | 1619 region_before.left == region_after.left && |
| 1620 region_before.top == region_after.top && | 1620 region_before.top == region_after.top && |
| 1621 region_before.right == region_after.right && | 1621 region_before.right == region_after.right && |
| 1622 region_before.bottom == region_after.bottom; | 1622 region_before.bottom == region_after.bottom; |
| 1623 ASSERT_FALSE(rects_equal); | 1623 ASSERT_FALSE(rects_equal); |
| 1624 } | 1624 } |
| 1625 | 1625 |
| 1626 #endif | 1626 #endif |
| OLD | NEW |