| 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/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/metrics/histogram_base.h" | 9 #include "base/metrics/histogram_base.h" |
| 10 #include "base/metrics/histogram_samples.h" | 10 #include "base/metrics/histogram_samples.h" |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1259 "behavior = 1;")); | 1259 "behavior = 1;")); |
| 1260 ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("exa")); | 1260 ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("exa")); |
| 1261 EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText()); | 1261 EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText()); |
| 1262 SetOmniboxText("exam"); | 1262 SetOmniboxText("exam"); |
| 1263 EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText()); | 1263 EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText()); |
| 1264 | 1264 |
| 1265 // TODO(jered): Remove this after fixing OnBlur(). | 1265 // TODO(jered): Remove this after fixing OnBlur(). |
| 1266 omnibox()->RevertAll(); | 1266 omnibox()->RevertAll(); |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 // TODO(dhollowa): Fix flakes. http://crbug.com/179930. | 1269 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, MostVisited) { |
| 1270 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_MostVisited) { | |
| 1271 content::WindowedNotificationObserver observer( | 1270 content::WindowedNotificationObserver observer( |
| 1272 chrome::NOTIFICATION_INSTANT_SENT_MOST_VISITED_ITEMS, | 1271 chrome::NOTIFICATION_INSTANT_SENT_MOST_VISITED_ITEMS, |
| 1273 content::NotificationService::AllSources()); | 1272 content::NotificationService::AllSources()); |
| 1274 // Initialize Instant. | 1273 // Initialize Instant. |
| 1275 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 1274 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 1276 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); | 1275 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); |
| 1277 | 1276 |
| 1278 // Get a handle to the NTP and the current state of the JS. | 1277 // Get a handle to the NTP and the current state of the JS. |
| 1279 ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp()); | 1278 ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp()); |
| 1280 content::WebContents* overlay = instant()->ntp_->contents(); | 1279 content::WebContents* overlay = instant()->ntp_->contents(); |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2650 | 2649 |
| 2651 // Test that if the LogDropdownShown() call records a histogram value. | 2650 // Test that if the LogDropdownShown() call records a histogram value. |
| 2652 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, LogDropdownShown) { | 2651 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, LogDropdownShown) { |
| 2653 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 2652 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 2654 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); | 2653 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); |
| 2655 int64 histogramValue = GetHistogramCount("Instant.TimeToFirstShowFromWeb"); | 2654 int64 histogramValue = GetHistogramCount("Instant.TimeToFirstShowFromWeb"); |
| 2656 ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("a")); | 2655 ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("a")); |
| 2657 EXPECT_EQ(histogramValue + 1, | 2656 EXPECT_EQ(histogramValue + 1, |
| 2658 GetHistogramCount("Instant.TimeToFirstShowFromWeb")); | 2657 GetHistogramCount("Instant.TimeToFirstShowFromWeb")); |
| 2659 } | 2658 } |
| OLD | NEW |