| 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/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 EXPECT_TRUE(ASCIIToUTF16("a") == find_bar->GetFindSelectedText()); | 188 EXPECT_TRUE(ASCIIToUTF16("a") == find_bar->GetFindSelectedText()); |
| 189 | 189 |
| 190 // Select tab B. Location bar should get focus. | 190 // Select tab B. Location bar should get focus. |
| 191 browser()->tab_strip_model()->ActivateTabAt(1, true); | 191 browser()->tab_strip_model()->ActivateTabAt(1, true); |
| 192 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); | 192 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // Flaky because the test server fails to start? See: http://crbug.com/96594. | 195 // Flaky because the test server fails to start? See: http://crbug.com/96594. |
| 196 // This tests that whenever you clear values from the Find box and close it that | 196 // This tests that whenever you clear values from the Find box and close it that |
| 197 // it respects that and doesn't show you the last search, as reported in bug: | 197 // it respects that and doesn't show you the last search, as reported in bug: |
| 198 // http://crbug.com/40121. | 198 // http://crbug.com/40121. For Aura see bug http://crbug.com/292299. |
| 199 IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { | 199 IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { |
| 200 #if defined(OS_MACOSX) | 200 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 201 // FindInPage on Mac doesn't use prepopulated values. Search there is global. | 201 // FindInPage on Mac doesn't use prepopulated values. Search there is global. |
| 202 return; | 202 return; |
| 203 #endif | 203 #endif |
| 204 ASSERT_TRUE(test_server()->Start()); | 204 ASSERT_TRUE(test_server()->Start()); |
| 205 | 205 |
| 206 // Make sure Chrome is in the foreground, otherwise sending input | 206 // Make sure Chrome is in the foreground, otherwise sending input |
| 207 // won't do anything and the test will hang. | 207 // won't do anything and the test will hang. |
| 208 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 208 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 209 | 209 |
| 210 // First we navigate to any page. | 210 // First we navigate to any page. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); | 316 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); |
| 317 | 317 |
| 318 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 318 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 319 browser(), ui::VKEY_V, true, false, false, false)); | 319 browser(), ui::VKEY_V, true, false, false, false)); |
| 320 | 320 |
| 321 ASSERT_NO_FATAL_FAILURE(observer.Wait()); | 321 ASSERT_NO_FATAL_FAILURE(observer.Wait()); |
| 322 FindNotificationDetails details; | 322 FindNotificationDetails details; |
| 323 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); | 323 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); |
| 324 EXPECT_TRUE(details.number_of_matches() > 0); | 324 EXPECT_TRUE(details.number_of_matches() > 0); |
| 325 } | 325 } |
| OLD | NEW |