Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: chrome/browser/ui/search/instant_extended_interactive_uitest.cc

Issue 14911005: Move instant support to SearchTabHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android_dbg test failures Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_page.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 #if defined(OS_LINUX) 353 #if defined(OS_LINUX)
354 #define MAYBE_UsesOverlayIfTabNotReady DISABLED_UsesOverlayIfTabNotReady 354 #define MAYBE_UsesOverlayIfTabNotReady DISABLED_UsesOverlayIfTabNotReady
355 #else 355 #else
356 #define MAYBE_UsesOverlayIfTabNotReady UsesOverlayIfTabNotReady 356 #define MAYBE_UsesOverlayIfTabNotReady UsesOverlayIfTabNotReady
357 #endif 357 #endif
358 358
359 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, MAYBE_UsesOverlayIfTabNotReady) { 359 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, MAYBE_UsesOverlayIfTabNotReady) {
360 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); 360 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
361 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); 361 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
362 362
363 // Open a new tab and start typing before InstantTab is properly hooked up. 363 // Open a new tab and navigate to instant URL. Start typing before InstantTab
364 // Should use the overlay. 364 // is properly hooked up. Should use the overlay.
365 ui_test_utils::NavigateToURLWithDisposition( 365 ui_test_utils::NavigateToURLWithDisposition(
366 browser(), 366 browser(),
367 GURL(chrome::kChromeUINewTabURL), 367 instant_url(),
368 NEW_FOREGROUND_TAB, 368 NEW_BACKGROUND_TAB,
369 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 369 ui_test_utils::BROWSER_TEST_NONE);
370 EXPECT_EQ(2, browser()->tab_strip_model()->count());
371 browser()->tab_strip_model()->ActivateTabAt(1, false);
370 ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query")); 372 ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
371 373
372 // But Instant tab should still exist. 374 // But Instant tab should still exist.
373 ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab()); 375 ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab());
374 EXPECT_FALSE(instant()->UseTabForSuggestions()); 376 EXPECT_FALSE(instant()->UseTabForSuggestions());
375 377
376 // Wait for Instant Tab support if it still hasn't finished loading. 378 // Wait for Instant Tab support if it still hasn't finished loading.
377 if (!instant()->instant_tab()->supports_instant()) { 379 if (!instant()->instant_tab()->supports_instant()) {
378 content::WindowedNotificationObserver instant_tab_observer( 380 content::WindowedNotificationObserver instant_tab_observer(
379 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, 381 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED,
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 IDS_TASK_MANAGER_INSTANT_OVERLAY_PREFIX, string16()); 2676 IDS_TASK_MANAGER_INSTANT_OVERLAY_PREFIX, string16());
2675 2677
2676 int instant_overlays = 0; 2678 int instant_overlays = 0;
2677 for (int i = 0; i < task_manager->ResourceCount(); ++i) { 2679 for (int i = 0; i < task_manager->ResourceCount(); ++i) {
2678 string16 title = task_manager->GetResourceTitle(i); 2680 string16 title = task_manager->GetResourceTitle(i);
2679 if (StartsWith(title, prefix, true)) 2681 if (StartsWith(title, prefix, true))
2680 ++instant_overlays; 2682 ++instant_overlays;
2681 } 2683 }
2682 EXPECT_EQ(2, instant_overlays); 2684 EXPECT_EQ(2, instant_overlays);
2683 } 2685 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698