| 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 "chrome/browser/ui/search/instant_test_utils.h" | 5 #include "chrome/browser/ui/search/instant_test_utils.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/search_engines/template_url_service.h" |
| 12 #include "chrome/browser/search_engines/template_url_service_factory.h" | 13 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 13 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 14 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 14 #include "chrome/browser/ui/search/search_tab_helper.h" | 15 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/test/base/interactive_test_utils.h" | 19 #include "chrome/test/base/interactive_test_utils.h" |
| 19 #include "chrome/test/base/ui_test_utils.h" | 20 #include "chrome/test/base/ui_test_utils.h" |
| 20 #include "components/search_engines/template_url_service.h" | |
| 21 #include "components/variations/entropy_provider.h" | 21 #include "components/variations/entropy_provider.h" |
| 22 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
| 23 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 #include "content/public/common/result_codes.h" | 25 #include "content/public/common/result_codes.h" |
| 26 #include "content/public/test/browser_test_utils.h" | 26 #include "content/public/test/browser_test_utils.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 std::string WrapScript(const std::string& script) { | 30 std::string WrapScript(const std::string& script) { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 return content::ExecuteScriptAndExtractBool(rvh, js_chrome, loaded); | 171 return content::ExecuteScriptAndExtractBool(rvh, js_chrome, loaded); |
| 172 } | 172 } |
| 173 | 173 |
| 174 base::string16 InstantTestBase::GetBlueText() { | 174 base::string16 InstantTestBase::GetBlueText() { |
| 175 size_t start = 0, end = 0; | 175 size_t start = 0, end = 0; |
| 176 omnibox()->GetSelectionBounds(&start, &end); | 176 omnibox()->GetSelectionBounds(&start, &end); |
| 177 if (start > end) | 177 if (start > end) |
| 178 std::swap(start, end); | 178 std::swap(start, end); |
| 179 return omnibox()->GetText().substr(start, end - start); | 179 return omnibox()->GetText().substr(start, end - start); |
| 180 } | 180 } |
| OLD | NEW |