| 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.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/string16.h" | 7 #include "base/string16.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/common/cancelable_request.h" | 10 #include "chrome/browser/common/cancelable_request.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 ui_test_utils::NavigateToURL(browser(), urls[i]); | 274 ui_test_utils::NavigateToURL(browser(), urls[i]); |
| 275 EXPECT_EQ(1, FindInPageWchar(web_contents, L"cat", | 275 EXPECT_EQ(1, FindInPageWchar(web_contents, L"cat", |
| 276 kFwd, kIgnoreCase, NULL)); | 276 kFwd, kIgnoreCase, NULL)); |
| 277 EXPECT_EQ(0, FindInPageWchar(web_contents, L"bat", | 277 EXPECT_EQ(0, FindInPageWchar(web_contents, L"bat", |
| 278 kFwd, kIgnoreCase, NULL)); | 278 kFwd, kIgnoreCase, NULL)); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 // Verify search for text within special URLs such as chrome:history, | 282 // Verify search for text within special URLs such as chrome:history, |
| 283 // chrome://downloads, data directory | 283 // chrome://downloads, data directory |
| 284 #if defined(OS_WIN) && defined(USE_AURA) |
| 284 // Disabled due to crbug.com/175711 | 285 // Disabled due to crbug.com/175711 |
| 285 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, | 286 #define MAYBE_SearchWithinSpecialURL \ |
| 286 DISABLED_SearchWithinSpecialURL) { | 287 DISABLED_SearchWithinSpecialURL |
| 288 #else |
| 289 #define MAYBE_SearchWithinSpecialURL \ |
| 290 SearchWithinSpecialURL |
| 291 #endif |
| 292 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { |
| 287 WebContents* web_contents = | 293 WebContents* web_contents = |
| 288 browser()->tab_strip_model()->GetActiveWebContents(); | 294 browser()->tab_strip_model()->GetActiveWebContents(); |
| 289 | 295 |
| 290 base::FilePath data_dir = | 296 base::FilePath data_dir = |
| 291 ui_test_utils::GetTestFilePath(base::FilePath(), base::FilePath()); | 297 ui_test_utils::GetTestFilePath(base::FilePath(), base::FilePath()); |
| 292 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(data_dir)); | 298 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(data_dir)); |
| 293 EXPECT_EQ(1, FindInPageWchar(web_contents, L"downloads", | 299 EXPECT_EQ(1, FindInPageWchar(web_contents, L"downloads", |
| 294 kFwd, kIgnoreCase, NULL)); | 300 kFwd, kIgnoreCase, NULL)); |
| 295 | 301 |
| 296 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); | 302 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); |
| (...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 content::RunAllPendingInMessageLoop(); // Needed on Linux. | 1503 content::RunAllPendingInMessageLoop(); // Needed on Linux. |
| 1498 EXPECT_TRUE(GetFindBarWindowInfo(&position, NULL)); | 1504 EXPECT_TRUE(GetFindBarWindowInfo(&position, NULL)); |
| 1499 | 1505 |
| 1500 ui_test_utils::NavigateToURLWithDisposition( | 1506 ui_test_utils::NavigateToURLWithDisposition( |
| 1501 browser(), url, NEW_FOREGROUND_TAB, | 1507 browser(), url, NEW_FOREGROUND_TAB, |
| 1502 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 1508 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 1503 chrome::CloseTab(browser()); | 1509 chrome::CloseTab(browser()); |
| 1504 EXPECT_TRUE(GetFindBarWindowInfo(&position2, NULL)); | 1510 EXPECT_TRUE(GetFindBarWindowInfo(&position2, NULL)); |
| 1505 EXPECT_EQ(position, position2); | 1511 EXPECT_EQ(position, position2); |
| 1506 } | 1512 } |
| OLD | NEW |