| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
| 9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| (...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 active_tab->GetController().GoBack(); | 1372 active_tab->GetController().GoBack(); |
| 1373 load_stop_observer.Wait(); | 1373 load_stop_observer.Wait(); |
| 1374 | 1374 |
| 1375 EXPECT_EQ(ASCIIToUTF16("flowers"), omnibox()->GetText()); | 1375 EXPECT_EQ(ASCIIToUTF16("flowers"), omnibox()->GetText()); |
| 1376 // Commit the search by pressing 'Enter'. | 1376 // Commit the search by pressing 'Enter'. |
| 1377 FocusOmnibox(); | 1377 FocusOmnibox(); |
| 1378 PressEnterAndWaitForNavigation(); | 1378 PressEnterAndWaitForNavigation(); |
| 1379 EXPECT_EQ(ASCIIToUTF16("flowers"), omnibox()->GetText()); | 1379 EXPECT_EQ(ASCIIToUTF16("flowers"), omnibox()->GetText()); |
| 1380 } | 1380 } |
| 1381 | 1381 |
| 1382 // Flaky on Mac and Linux Tests bots. | 1382 // Flaky: crbug.com/253092. |
| 1383 #if defined(OS_MACOSX) || defined(OS_LINUX) | |
| 1384 #define MAYBE_UpdateSearchQueryOnForwardNavigation DISABLED_UpdateSearchQueryOnF
orwardNavigation | |
| 1385 #else | |
| 1386 #define MAYBE_UpdateSearchQueryOnForwardNavigation UpdateSearchQueryOnForwardNav
igation | |
| 1387 #endif | |
| 1388 // Test to verify that the omnibox search query is updated on browser | 1383 // Test to verify that the omnibox search query is updated on browser |
| 1389 // forward button press events. | 1384 // forward button press events. |
| 1390 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, | 1385 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, |
| 1391 MAYBE_UpdateSearchQueryOnForwardNavigation) { | 1386 DISABLED_UpdateSearchQueryOnForwardNavigation) { |
| 1392 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 1387 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 1393 | 1388 |
| 1394 // Focus omnibox and confirm overlay isn't shown. | 1389 // Focus omnibox and confirm overlay isn't shown. |
| 1395 FocusOmniboxAndWaitForInstantNTPSupport(); | 1390 FocusOmniboxAndWaitForInstantNTPSupport(); |
| 1396 | 1391 |
| 1397 // Create an observer to wait for the instant tab to support Instant. | 1392 // Create an observer to wait for the instant tab to support Instant. |
| 1398 content::WindowedNotificationObserver observer( | 1393 content::WindowedNotificationObserver observer( |
| 1399 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, | 1394 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, |
| 1400 content::NotificationService::AllSources()); | 1395 content::NotificationService::AllSources()); |
| 1401 | 1396 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1651 content::WindowedNotificationObserver observer( | 1646 content::WindowedNotificationObserver observer( |
| 1652 content::NOTIFICATION_LOAD_STOP, | 1647 content::NOTIFICATION_LOAD_STOP, |
| 1653 content::Source<content::NavigationController>( | 1648 content::Source<content::NavigationController>( |
| 1654 &ntp_contents->GetController())); | 1649 &ntp_contents->GetController())); |
| 1655 service->SetDefaultSearchProvider(template_url); | 1650 service->SetDefaultSearchProvider(template_url); |
| 1656 observer.Wait(); | 1651 observer.Wait(); |
| 1657 | 1652 |
| 1658 // Make sure the URL remains the same. | 1653 // Make sure the URL remains the same. |
| 1659 EXPECT_EQ(ntp_url, ntp_contents->GetURL()); | 1654 EXPECT_EQ(ntp_url, ntp_contents->GetURL()); |
| 1660 } | 1655 } |
| OLD | NEW |