| 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 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/metrics/field_trial.h" |
| 12 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_instant_controller.h" | 16 #include "chrome/browser/ui/browser_instant_controller.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 17 #include "chrome/browser/ui/browser_window.h" |
| 17 #include "chrome/browser/ui/omnibox/location_bar.h" | 18 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 18 #include "chrome/browser/ui/search/instant_controller.h" | 19 #include "chrome/browser/ui/search/instant_controller.h" |
| 19 #include "chrome/common/search_types.h" | 20 #include "chrome/common/search_types.h" |
| 20 #include "net/test/spawned_test_server/spawned_test_server.h" | 21 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 22 | 23 |
| 23 class BrowserInstantController; | 24 class BrowserInstantController; |
| 24 class InstantController; | 25 class InstantController; |
| 25 class InstantModel; | 26 class InstantModel; |
| 26 class OmniboxView; | 27 class OmniboxView; |
| 27 | 28 |
| 28 namespace content { | 29 namespace content { |
| 29 class WebContents; | 30 class WebContents; |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 // This utility class is meant to be used in a "mix-in" fashion, giving the | 33 // This utility class is meant to be used in a "mix-in" fashion, giving the |
| 33 // derived test class additional Instant-related functionality. | 34 // derived test class additional Instant-related functionality. |
| 34 class InstantTestBase { | 35 class InstantTestBase { |
| 35 protected: | 36 protected: |
| 36 InstantTestBase() | 37 InstantTestBase(); |
| 37 : https_test_server_( | 38 virtual ~InstantTestBase(); |
| 38 net::SpawnedTestServer::TYPE_HTTPS, | |
| 39 net::BaseTestServer::SSLOptions(), | |
| 40 base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))), | |
| 41 init_suggestions_url_(false) { | |
| 42 } | |
| 43 virtual ~InstantTestBase() {} | |
| 44 | 39 |
| 45 protected: | 40 protected: |
| 46 void SetupInstant(Browser* browser); | 41 void SetupInstant(Browser* browser); |
| 47 void Init(const GURL& instant_url, bool init_suggestions_url); | 42 void Init(const GURL& instant_url, bool init_suggestions_url); |
| 48 | 43 |
| 49 void SetInstantURL(const std::string& url); | 44 void SetInstantURL(const std::string& url); |
| 50 | 45 |
| 51 void set_browser(Browser* browser) { | 46 void set_browser(Browser* browser) { |
| 52 browser_ = browser; | 47 browser_ = browser; |
| 53 } | 48 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // HTTPS Testing server, started on demand. | 105 // HTTPS Testing server, started on demand. |
| 111 net::SpawnedTestServer https_test_server_; | 106 net::SpawnedTestServer https_test_server_; |
| 112 | 107 |
| 113 // Set to true to initialize suggestions URL in default search provider. | 108 // Set to true to initialize suggestions URL in default search provider. |
| 114 bool init_suggestions_url_; | 109 bool init_suggestions_url_; |
| 115 | 110 |
| 116 DISALLOW_COPY_AND_ASSIGN(InstantTestBase); | 111 DISALLOW_COPY_AND_ASSIGN(InstantTestBase); |
| 117 }; | 112 }; |
| 118 | 113 |
| 119 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_ | 114 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_ |
| OLD | NEW |