Chromium Code Reviews| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 browser()->tab_strip_model()->ActivateTabAt(0, true); | 272 browser()->tab_strip_model()->ActivateTabAt(0, true); |
| 273 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), | 273 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
| 274 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); | 274 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); |
| 275 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarSelectedText()); | 275 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarSelectedText()); |
| 276 | 276 |
| 277 // Select tab B. Location bar should get focus. | 277 // Select tab B. Location bar should get focus. |
| 278 browser()->tab_strip_model()->ActivateTabAt(1, true); | 278 browser()->tab_strip_model()->ActivateTabAt(1, true); |
| 279 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); | 279 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
| 280 } | 280 } |
| 281 | 281 |
| 282 // FindInPage on Mac doesn't use prepopulated values. Search there is global. | |
| 283 #if !defined(OS_MACOSX) && !defined(USE_AURA) | |
|
Peter Kasting
2014/03/18 02:43:58
Why is this test excluded for Aura, anyway?
| |
| 282 // Flaky because the test server fails to start? See: http://crbug.com/96594. | 284 // Flaky because the test server fails to start? See: http://crbug.com/96594. |
| 283 // This tests that whenever you clear values from the Find box and close it that | 285 // This tests that whenever you clear values from the Find box and close it that |
| 284 // it respects that and doesn't show you the last search, as reported in bug: | 286 // it respects that and doesn't show you the last search, as reported in bug: |
| 285 // http://crbug.com/40121. For Aura see bug http://crbug.com/292299. | 287 // http://crbug.com/40121. For Aura see bug http://crbug.com/292299. |
| 286 IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { | 288 IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { |
| 287 #if defined(OS_MACOSX) || defined(USE_AURA) | |
| 288 // FindInPage on Mac doesn't use prepopulated values. Search there is global. | |
| 289 return; | |
| 290 #endif | |
| 291 ASSERT_TRUE(test_server()->Start()); | 289 ASSERT_TRUE(test_server()->Start()); |
| 292 | 290 |
| 293 // Make sure Chrome is in the foreground, otherwise sending input | 291 // Make sure Chrome is in the foreground, otherwise sending input |
| 294 // won't do anything and the test will hang. | 292 // won't do anything and the test will hang. |
| 295 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 293 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 296 | 294 |
| 297 // First we navigate to any page. | 295 // First we navigate to any page. |
| 298 GURL url = test_server()->GetURL(kSimplePage); | 296 GURL url = test_server()->GetURL(kSimplePage); |
| 299 ui_test_utils::NavigateToURL(browser(), url); | 297 ui_test_utils::NavigateToURL(browser(), url); |
| 300 | 298 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 331 browser(), ui::VKEY_ESCAPE, false, false, false, false)); | 329 browser(), ui::VKEY_ESCAPE, false, false, false, false)); |
| 332 | 330 |
| 333 // Press F3 to trigger FindNext. | 331 // Press F3 to trigger FindNext. |
| 334 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 332 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 335 browser(), ui::VKEY_F3, false, false, false, false)); | 333 browser(), ui::VKEY_F3, false, false, false, false)); |
| 336 | 334 |
| 337 // After the Find box has been reopened, it should still have no prepopulate | 335 // After the Find box has been reopened, it should still have no prepopulate |
| 338 // value. | 336 // value. |
| 339 EXPECT_EQ(base::string16(), GetFindBarText()); | 337 EXPECT_EQ(base::string16(), GetFindBarText()); |
| 340 } | 338 } |
| 339 #endif | |
| 341 | 340 |
| 342 // Flaky on Win. http://crbug.com/92467 | 341 // Flaky on Win. http://crbug.com/92467 |
| 343 // Flaky on ChromeOS. http://crbug.com/118216 | 342 // Flaky on ChromeOS. http://crbug.com/118216 |
| 344 // Flaky on linux aura. http://crbug.com/163931 | 343 // Flaky on linux aura. http://crbug.com/163931 |
| 345 #if defined(TOOLKIT_VIEWS) | 344 #if defined(TOOLKIT_VIEWS) |
| 346 #define MAYBE_PasteWithoutTextChange DISABLED_PasteWithoutTextChange | 345 #define MAYBE_PasteWithoutTextChange DISABLED_PasteWithoutTextChange |
| 347 #else | 346 #else |
| 348 #define MAYBE_PasteWithoutTextChange PasteWithoutTextChange | 347 #define MAYBE_PasteWithoutTextChange PasteWithoutTextChange |
| 349 #endif | 348 #endif |
| 350 | 349 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 ui_test_utils::UrlLoadObserver observer( | 436 ui_test_utils::UrlLoadObserver observer( |
| 438 GURL("about:blank"), content::NotificationService::AllSources()); | 437 GURL("about:blank"), content::NotificationService::AllSources()); |
| 439 | 438 |
| 440 // Send Ctrl-Enter, should cause navigation to about:blank. | 439 // Send Ctrl-Enter, should cause navigation to about:blank. |
| 441 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 440 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 442 browser(), ui::VKEY_RETURN, true, false, false, false)); | 441 browser(), ui::VKEY_RETURN, true, false, false, false)); |
| 443 | 442 |
| 444 observer.Wait(); | 443 observer.Wait(); |
| 445 } | 444 } |
| 446 #endif | 445 #endif |
| OLD | NEW |