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

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 11592004: InstantExtended: tests! (Closed) Base URL: http://git.chromium.org/chromium/src.git@fixmyterms
Patch Set: Tests actually work. Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index fece178d33b422580d091bb8f394d22a32705798..5809acd0b6e69607d885a760d057355a2ab76b8b 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -158,6 +158,7 @@ InstantController::InstantController(chrome::BrowserInstantController* browser,
extended_enabled_(extended_enabled),
instant_enabled_(false),
use_local_preview_only_(use_local_preview_only),
+ in_testing_mode_(false),
model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
last_omnibox_text_has_inline_autocompletion_(false),
last_verbatim_(false),
@@ -921,6 +922,10 @@ void InstantController::NavigateToURL(const GURL& url,
browser_->OpenURLInCurrentTab(url, transition);
}
+void InstantController::SetTestingMode() {
+ in_testing_mode_ = true;
+}
+
bool InstantController::ResetLoader(const TemplateURL* template_url,
const content::WebContents* active_tab,
bool fallback_to_local) {
@@ -1172,7 +1177,7 @@ bool InstantController::GetInstantURL(const TemplateURL* template_url,
// Extended mode should always use HTTPS. TODO(sreeram): This section can be
// removed if TemplateURLs supported "https://{google:host}/..." instead of
// only supporting "{google:baseURL}...".
- if (extended_enabled_) {
+ if (extended_enabled_ && !in_testing_mode_) {
GURL url_obj(*instant_url);
if (!url_obj.is_valid())
return false;

Powered by Google App Engine
This is Rietveld 408576698