| 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 "chrome/browser/ui/toolbar/toolbar_model.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/search_engines/template_url.h" | 9 #include "chrome/browser/search_engines/template_url.h" |
| 10 #include "chrome/browser/search_engines/template_url_service.h" | 10 #include "chrome/browser/search_engines/template_url_service.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 119 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 120 profile(), &TemplateURLServiceFactory::BuildInstanceFor); | 120 profile(), &TemplateURLServiceFactory::BuildInstanceFor); |
| 121 } | 121 } |
| 122 virtual void TearDown() OVERRIDE { BrowserWithTestWindowTest::TearDown(); } | 122 virtual void TearDown() OVERRIDE { BrowserWithTestWindowTest::TearDown(); } |
| 123 | 123 |
| 124 protected: | 124 protected: |
| 125 | 125 |
| 126 void ResetDefaultTemplateURL() { | 126 void ResetDefaultTemplateURL() { |
| 127 TemplateURLData data; | 127 TemplateURLData data; |
| 128 data.SetURL("http://google.com/search?q={searchTerms}"); | 128 data.SetURL("http://google.com/search?q={searchTerms}"); |
| 129 data.search_terms_replacement_key = "{google:instantExtendedEnabledKey}"; |
| 129 TemplateURL* search_template_url = new TemplateURL(profile(), data); | 130 TemplateURL* search_template_url = new TemplateURL(profile(), data); |
| 130 TemplateURLService* template_url_service = | 131 TemplateURLService* template_url_service = |
| 131 TemplateURLServiceFactory::GetForProfile(profile()); | 132 TemplateURLServiceFactory::GetForProfile(profile()); |
| 132 template_url_service->Add(search_template_url); | 133 template_url_service->Add(search_template_url); |
| 133 template_url_service->SetDefaultSearchProvider(search_template_url); | 134 template_url_service->SetDefaultSearchProvider(search_template_url); |
| 134 ASSERT_NE(0, search_template_url->id()); | 135 ASSERT_NE(0, search_template_url->id()); |
| 135 template_url_service->Load(); | 136 template_url_service->Load(); |
| 136 } | 137 } |
| 137 | 138 |
| 138 void NavigateAndCheckText(const GURL& url, | 139 void NavigateAndCheckText(const GURL& url, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 AddTab(browser(), GURL(chrome::kAboutBlankURL)); | 200 AddTab(browser(), GURL(chrome::kAboutBlankURL)); |
| 200 for (size_t i = 0; i < arraysize(test_items); ++i) { | 201 for (size_t i = 0; i < arraysize(test_items); ++i) { |
| 201 const TestItem& test_item = test_items[i]; | 202 const TestItem& test_item = test_items[i]; |
| 202 NavigateAndCheckText(test_item.url, | 203 NavigateAndCheckText(test_item.url, |
| 203 test_item.expected_text, | 204 test_item.expected_text, |
| 204 test_item.expected_replace_text_active, | 205 test_item.expected_replace_text_active, |
| 205 test_item.would_replace, | 206 test_item.would_replace, |
| 206 test_item.should_display); | 207 test_item.should_display); |
| 207 } | 208 } |
| 208 } | 209 } |
| OLD | NEW |